solrj

Solr sort by the value of function query does not work

左心房为你撑大大i 提交于 2019-12-12 05:37:23
问题 I'm working on a feature which relies on sorting the value of function query. Function query is as below : http://localhost:8983/solr/collection/select?q=*:*&sort=if(exists(f1_t), f1_t, theme)+ASC&wt=json&indent=true The sort function is " if(exists(f1_t), f1_t, theme) ASC " So basically what I'm doing is if the field " f1_t " (which is a dynamic field of type TextField) exists then the sorting is based on the value of the field else the sorting is based on the value of "theme" which is also

reindexing json object into solr by adding only unique elements

心不动则不痛 提交于 2019-12-12 02:25:51
问题 I have indexed json object into solr using httpclient and when I tried to index again, duplicate records are getting indexed. So how to update the records into solr, everytime I index I want to update the records. Thanks in advance 回答1: In your JSON Object include an ID field inside your json object and it should be unique, for example some random number like 65746 . When you will try to index this document again, solr will check for id .If id is same, solr will not index that whole document

solr java.lang.NoClassDefFoundError: org/apache/solr/common/ResourceLoader

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:14:18
问题 For a tests reason I am trying locally to use EmbeddedSolrSolver (I know it's deprected it's only for tests). I was fallowing this example http://balabtech.wordpress.com/2011/10/13/embedded-solr-server-using-java/ and the official wiki as well http://wiki.apache.org/solr/Solrj I am still gettinga an error java.lang.NoClassDefFoundError: org/apache/solr/common/ResourceLoader at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:787) at java

Solrj indexing mechanism

◇◆丶佛笑我妖孽 提交于 2019-12-11 21:12:23
问题 I have a question about indexing mechanism using Solr in Java. If I create a documents and i want to find only field "name", solr will be index all fields? Or only index by field "name" in each document? 回答1: If you tell Solr to only store the field name in your schema, then only the field name will be stored. If you instruct Solr to store everything you send to it (like in the schemaless mode) and you send 400 fields, each of those fields will be stored. If you want to store information but

Solrj full-import not working

做~自己de王妃 提交于 2019-12-11 21:10:08
问题 I configured solr server on my Glassfish and everything works well. The problem is when I try to make reindex call using Solrj in my Java application. I'm using delta import via full import but it works well outside Solrj so I suppose there isn't problem http://wiki.apache.org/solr/DataImportHandlerDeltaQueryViaFullImport When I call http://localhost:8787/solr-4.2.1/db/dataimport?command=full-import&clean=true then reindex is correct and I see my new results. The problems starts when I do it

solrj “org.apache.solr.common.util.SimpleOrderedMap cannot be cast to java.util.Map” exception when using “/suggest” handler

浪尽此生 提交于 2019-12-11 18:42:24
问题 I get the class cast exception when trying to run the solrj program using /suggest handler. I am able to get the suggestion response from Solr Admin UI, but when the same is being tried from solrj client the above exception arises. The solr-config.xml entries are as follows : <searchComponent name="suggest" class="solr.SuggestComponent"> <lst name="suggester"> <str name="name">mySuggester</str> <str name="lookupImpl">FuzzyLookupFactory</str> <str name="dictionaryImpl"

Solr - Differentiating between exact match and Partial Match OR grouping based on scores

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:37:01
问题 In my current Solr search implementation, I get results based on scores - which is fine. However, I want to create two groups from the results. The first group should be a relevant group (when all the query words are present in the document) and the second group should be the related group (when only partial words from query exist in the document). "response":{"numFound":206,"start":0,"maxScore":11.856699,"docs":[ { "Product":["KW Cyber Security Digital Product"], "score":11.856699}, {

SolrJ - Indexing multiple classes and ensuring document uniqueness

旧时模样 提交于 2019-12-11 16:28:06
问题 I want to use SolrJ for indexing a set of Java classes. Each class instance is determined by its id which is unique within a class. However, by using the Solr @Field annotation for making Solr documents from these classes it turns out that this annotation doesn't guarantee uniqueness of the created documents stored in the Solr index (same id values may belong to multiple classes). I tried combining the annotation approach with the Solr UUID data type for generating unique id values into a

Getting java.lang.NoClassDefFoundError while using solr-solrj-3.6.1.jar

跟風遠走 提交于 2019-12-11 14:11:11
问题 Using Solrj to connect to solr indexes. Used jar solr-solrj-3.6.1.jar which I got by adding below maven dependency <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> <version>3.6.1</version> </dependency> I see that CommonsHttpSolrServer is deprecated and hence using HttpSolrServer . During run time i get the below error, Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient Just adding solr-solrj-3.6.1.jar is not

SolrServer: is schema required when using addBean( Object bean )?

核能气质少年 提交于 2019-12-11 13:51:53
问题 I saw two methods in SolrServer: addBean( Object bean ) and add (SolrDocument doc ). My question is: If I can add objects directly using addBean(), do I need to create any schema for the object? Doesn't Solr look at fields of the object and determine the schema from there? Or does Solr serialize the object into a string first and then proceeds with a normal add? (This might require schema specification) 回答1: Solr supports a Schemaless Mode . When starting Solr this way, you are initially not