solrj

Solr and MySQL, How to keep an updated index, and, is a DB even needed if it's simple?

拈花ヽ惹草 提交于 2019-12-08 22:07:06
问题 I'm a complete beginner with Solr, so bear with me. :) In my current project I have a very simple DB - just 1 table that contains 4 fields: id, name, subject, msg. The way I understand, every time a new record is added (or removed), I'd need to add that record to the index, essentially performing two operations: inserting the record into the DB and adding it to the index. Is this standard procedure, or is there a way to direct Solr to automatically reindex the DB table either at some interval

to get the count of multi valued field in solr

梦想的初衷 提交于 2019-12-08 19:11:40
问题 In solr i have a multiValued field called animal and it has the values {cat,dog} is it possible to get the number of values inside the multiValued field in solr(in my example 2)? 回答1: If you want to count the items in a multivalued field use CountFieldValuesUpdateProcessorFactory 回答2: There is no direct way to get the count of items in a multivalued field. You can always maintain the field count during indexing and use it. If not using during query time, you can always count the list size. 来源

SolrCloud: workaround for classic pagination with “start,rows” parameters

依然范特西╮ 提交于 2019-12-08 12:02:01
问题 I have SolrCloud with 3 shards. My purpose : select and process all products from category. Current implementation : Portion selection in cycle. 1st iteration: q=cat:1&start=0&rows=100 2nd iteration: q=cat:1&start=100&rows=100 3th: q=cat:1&start=200&rows=100 ... But growing "start", performance is down. Explanation here: https://wiki.apache.org/solr/DistributedSearch Makes it more inefficient to use a high "start" parameter. For example, if you request start=500000&rows=25 on an index with

Embedded Solr DIH

二次信任 提交于 2019-12-08 11:09:25
问题 Can anyone tell me how to configure Embedded Solr DIH in Solrj? I tried this.. SolrQuery qry = new SolrQuery(); qry.setQueryType("/import"); qry.setParam("command", "full-import"); qry.setParam("clean", false); embeddedSolrServer.query(qry); And it stops at this point. 1437 [main] INFO org.apache.solr.core.CoreContainer - registering core: main 1468 [Thread-1] INFO org.apache.solr.handler.dataimport.DataImporter - Starting Full Import 1468 [main] INFO org.apache.solr.core.SolrCore - [main]

Solr DataImportHandler delta import

笑着哭i 提交于 2019-12-08 06:44:31
问题 I am using DataImportHandler for indexing data in SOLR. I used full-import to index all the data in the my database which is around 10000 products.Now I am confused with the delta-import usage? Does it index the new data added into the database on interval basis i mean it is going to index the new data added to my table around 10 rows or it just updates the changes in the already indexed data. Can anyone please explain it to me with simple example as soon as you can. 回答1: The

quoted format json from Solrj

爱⌒轻易说出口 提交于 2019-12-08 05:42:00
问题 It looks like the QueryResponse from Solrj has no mean to give you a quoted Json string with wt=on or not. All I received is something like this {responseHeader={status=0,QTime=2,params= {fl=id,productName,imageFront,priceEng,priceEngExp... Question: 1) Am I missing something here ? Or there is no way to get the json response properly from the Solr server by Solrj. 2) Now on my client, if I convert the non-quoted json string from Solrj, does it mean it was done two times, once in server time

solr transaction management using solrj

╄→гoц情女王★ 提交于 2019-12-08 03:02:25
问题 How to handle transaction management in Solr using Solrj? There is not much documentation related to this on the net. But I would appreciate if someone can provide any links or information related to transaction management using SolrJ. 回答1: You would have to programatically deal with the transactions in SolrJ. When dealing with multiple writes. Use the SolrServer api add method to add the SolrInputDoucments to the server. When all the SolrInputDocuments are added, call the commit method from

solr cannot delete anything

不打扰是莪最后的温柔 提交于 2019-12-08 02:02:02
问题 I'm trying to delete documents on my solr server, but it doesn't work and I get no error. I tried deleting via browser, curl and solrj and nothing works. (browser and curl as explained here: Solr delete not working for some reason) My solrj code is: server.deleteByQuery("*:*"); server.deleteById("*"); server.deleteById("guid:*"); server.commit(true, true); UpdateRequest update = new UpdateRequest(); update.deleteByQuery("*:*"); update.setCommitWithin(0); server.request(update); server.commit

How do I add one document to solr index using solrj?

流过昼夜 提交于 2019-12-07 16:31:21
问题 I can reindex an entire solr core using the following code: public void indexSolr() throws SolrServerException, IOException { HttpSolrServer solr = new HttpSolrServer(solrIndexPath); logger.info("Indexing fcv solr at " + solrIndexPath); // reindex to pickup new articles ModifiableSolrParams params = new ModifiableSolrParams(); params.set("qt", "/" + solrDataImportPath); params.set("command", "full-import"); params.set("clean", "true"); params.set("commit", "true"); solr.query(params); } How

How do I remove logically deleted documents from a Solr index?

坚强是说给别人听的谎言 提交于 2019-12-07 14:39:12
问题 I am implementing Solr for a free text search for a project where the records available to be searched will need to be added and deleted on a large scale every day. Because of the scale I need to make sure that the size of the index is appropriate. On my test installation of Solr, I index a set of 10 documents. Then I make a change in one of the document and want to replace the document with the same ID in the index. This works correctly and behaves as expected when I search. I am using this