solr

How to index data in a specific shard using solrj

六眼飞鱼酱① 提交于 2020-01-23 13:35:13
问题 I am using solrj as client to index documents into solr cloud (Using solr4.5) I had a requirement to save documents based on tenant_id, so i am trying to do document routing . Which is possible only if the collection is created using numShards parameter (http://searchhub.org/2013/06/13/solr-cloud-document-routing/) I have two instances of solr in solr cloud(example1/solr and example2/solr) and exrenal zookeeper which is running in 2181 port. Both the instances consist collection called

How to index data in a specific shard using solrj

泪湿孤枕 提交于 2020-01-23 13:35:06
问题 I am using solrj as client to index documents into solr cloud (Using solr4.5) I had a requirement to save documents based on tenant_id, so i am trying to do document routing . Which is possible only if the collection is created using numShards parameter (http://searchhub.org/2013/06/13/solr-cloud-document-routing/) I have two instances of solr in solr cloud(example1/solr and example2/solr) and exrenal zookeeper which is running in 2181 port. Both the instances consist collection called

Does schema change require reindex of all Solr documents or just documents containing the changed schema fields?

女生的网名这么多〃 提交于 2020-01-23 07:43:07
问题 I have millions of documents in my Solr index. Only a thousand of those documents have field A, whose schema I want to change. The schema changes include changing multiValued from true to false, stored from false to true, and type from text to string, things that require re-index. Re-indexing the thousand documents will take me a few minutes, where-as re-indexing everything will take days. The re-indexing page on Solr wiki (http://wiki.apache.org/solr/HowToReindex) says "you may need to

could to find or load main class org.apache.nutch.crawl.InjectorJob

十年热恋 提交于 2020-01-23 05:35:14
问题 I'm using Linux with Hadoop, Cloudera and HBase. Could you tell me how to correct this error? Error: could to find or load main class org.apache.nutch.crawl.InjectorJob The following command gave me the error: src/bin/nutch inject crawl/crawldb dmoz/ if you need any other information ask for me. 回答1: I think you probably missed a step or two. Please confirm: Did you install Apache ANT and then navigate to the nutch folder and type in "ant"? Did you set the environment variables: NUTCH_JAVA

Getting maximum value of field in solr

旧街凉风 提交于 2020-01-22 19:43:35
问题 I'd like to boost my query by the item's view count; I'd like to use something like view_count / max_view_count for this purpose, to be able to measure how the item's view count relates to the biggest view count in the index. I know how to boost the results with a function query, but how can I easily get the maximum view count? If anybody could provide an example it would be very helpful... 回答1: There aren't any aggregate functions under solr in the way you might be thinking about them from

Getting maximum value of field in solr

冷暖自知 提交于 2020-01-22 19:42:06
问题 I'd like to boost my query by the item's view count; I'd like to use something like view_count / max_view_count for this purpose, to be able to measure how the item's view count relates to the biggest view count in the index. I know how to boost the results with a function query, but how can I easily get the maximum view count? If anybody could provide an example it would be very helpful... 回答1: There aren't any aggregate functions under solr in the way you might be thinking about them from

Multi-word synonym search in Solr

淺唱寂寞╮ 提交于 2020-01-22 15:45:51
问题 I'm trying to use a synonym filter to search for a phrase. peter=> spider man, spiderman, Mary Jane, ..... I use the default configuration. When I put these synonyms into synonym.txt and restart Solr it seems to work only partially: It starts to search for "spider" , "man" , "spiderman" , "Mary" and "Jane" but what I want to search for are the meaningful combinations - like "spider man" , "Mary Jane" and "spiderman" . 回答1: Yes sadly this is a well known problem due to how the Solr query

Can SOLR perform an UPSERT?

。_饼干妹妹 提交于 2020-01-21 13:39:46
问题 I've been attempting to do the equivalent of an UPSERT (insert or update if already exists) in solr. I only know what does not work and the solr/lucene documentation I have read has not been helpful. Here's what I have tried: curl 'localhost:8983/solr/update?commit=true' -H 'Content-type:application/json' -d '[{"id":"1","name":{"set":"steve"}}]' {"responseHeader":{"status":409,"QTime":2},"error":{"msg":"Document not found for update. id=1","code":409}} I do up to 50 updates in one request and

Can SOLR perform an UPSERT?

帅比萌擦擦* 提交于 2020-01-21 13:37:40
问题 I've been attempting to do the equivalent of an UPSERT (insert or update if already exists) in solr. I only know what does not work and the solr/lucene documentation I have read has not been helpful. Here's what I have tried: curl 'localhost:8983/solr/update?commit=true' -H 'Content-type:application/json' -d '[{"id":"1","name":{"set":"steve"}}]' {"responseHeader":{"status":409,"QTime":2},"error":{"msg":"Document not found for update. id=1","code":409}} I do up to 50 updates in one request and

Solrj Query - Get the most relevant record first

本秂侑毒 提交于 2020-01-21 05:44:06
问题 I have some documents in Solr 4.0 . I want the most relevant records to be displayed first and then the less relevant ones. For eg, I have 3 documents with titles as follows - Towards Income Distribution Policy Income distribution and economic policies Income Distribution Policy in Developing Countries Now when I query something like q=title:Income Distribution Policy , I would like document number 3 to show up first (as the first 3 words are an exact match) then I want the document number 1