solrj

Trying to implement scoped autosuggestions with solr

前提是你 提交于 2019-12-24 00:48:41
问题 I am trying to implement scoped autosuggestions like in ecommerce websites like amazon etc. eg. if i type Lego , the suggestions should come like Lego las in Names Lego in Toys where Names and Toys are solr field names. closest aid i got is from this discussion: solr autocomplete with scope is it possible? Which informed me that it isn't possible with the suggester which I am currently using. Until now, using the suggester I am able to achieve autosuggestions from a single solr field. [the

Adding my own classes to solr 5.3.1

倾然丶 夕夏残阳落幕 提交于 2019-12-23 05:21:51
问题 I want to update my solr based application from Solr 4 to Solr 5.3.1 I just found out, since Solr 5.2 it is no longer possible to run Solr as a WebApp. So instead of packaging the project (with solr as Maven dependencies) as a WAR and running it with a separate Jetty, now I need to put my source code into the Solr. But how can i do this? I tried to package my project as a JAR and put it in the folder /solr-5.3.1/contrib/mySearchApplication/lib/mysearch.jar and I added this path in solrconfig

Using Spring Solr Data or Not for Flexible Requests as Like Backup?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 03:17:13
问题 I want to implement an application at Spring that interacts with my current Solr or SolrCloud. I consider of using Spring Data Solr or not. However I think that there is no CloudSolrServer implemented at it yet on the other hand if I just run a query like that: http://localhost:8983/solr/replication?command=backup and check whether backup is completed or not(I will do a get request, parse JSON and will see that last backup time is changed or not) How I can integrate it with Spring Data Solr?

How can I Ignore some fields in a SOLR query

大兔子大兔子 提交于 2019-12-22 13:06:08
问题 I have Solr 5.3.1 and need to do query for all field except some field (what I need search in some field not retrieve fields this way to retrieve [/?q=query&fl=field1,field2,field3] ) i try with some solution but not work 1.How to exclude fields in a SOLR query [this soluation not work] 2.[the below solution work but take more time] query = field1:"+txtSearch+"OR field1:"+ txtSearch+" OR field1:"+txtSearch 3.I set indexed="false" in data-config.xml it only Ignore search in this field but when

How can I Ignore some fields in a SOLR query

你说的曾经没有我的故事 提交于 2019-12-22 13:05:23
问题 I have Solr 5.3.1 and need to do query for all field except some field (what I need search in some field not retrieve fields this way to retrieve [/?q=query&fl=field1,field2,field3] ) i try with some solution but not work 1.How to exclude fields in a SOLR query [this soluation not work] 2.[the below solution work but take more time] query = field1:"+txtSearch+"OR field1:"+ txtSearch+" OR field1:"+txtSearch 3.I set indexed="false" in data-config.xml it only Ignore search in this field but when

Solrj IOException occured when talking to server

穿精又带淫゛_ 提交于 2019-12-22 11:29:20
问题 I am using basic authentication. My solr version is 4.1. I can get query results but when I try to index documents I am getting the following error message: org.apache.solr.client.solrj.SolrServerException: IOException occured when talking to server at: http://192.168.0.1:8983/solr/my_core at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:416) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:181) at org.apache.solr.client.solrj

How to insert Bean object which has many child Bean in SolrJ

╄→гoц情女王★ 提交于 2019-12-21 20:47:04
问题 I have a Bean Class Activity which associates List of Profiles and a User Bean. Now If I am trying to insert this Activity bean in Solr by SOLRJ, it is giving me null pointer exception. The Exception is causing by below piece of code: public <T> boolean insert (T bean) { try { UpdateResponse response = solrClient.addBean(bean); System.out.println("insert bean ElapsedTime: " + response.getElapsedTime()); solrClient.commit(); return true; } catch (IOException | SolrServerException e) { e

Solr - highlight query phrase

二次信任 提交于 2019-12-21 17:01:39
问题 Is it possible to highlight whole query terms? f.e. when I ask for "United States" I want to get: <em>United States</em> and not: <em>United</em> <em>States</em> I've searched the whole Internet for an answer, used all combinations of hl.mergeContiguous , hl.usePhrasesHighlighter and hl.highlightMultiTerm parameters and still cannot make it work. my query is: http://localhost:8983/solandra/idxPosts.proj350_139/select?q=post_text:"Janusz Palikot"&hl=true&hl.fl=post_text&hl.mergeContiguous=true

Solr doesn't overwrite - duplicated uniqueKey entries

て烟熏妆下的殇ゞ 提交于 2019-12-21 12:28:21
问题 I have a problem with Solr 5.3.1 . My Schema is rather simple. I have one uniqueKey which is the "id" as string. indexed, stored and required, non-multivalued. I add documents first with a "content_type:document_unfinished" and then overwrite the same document, with the same id but another content_type:document. The document is then twice in the index. Again, the only uniqueKey is "id", as string. The id is coming originally from a mysql-index primary int. Also looks like this happens not

Solr/Solrj: How can I determine the total number of documents in an index?

折月煮酒 提交于 2019-12-20 16:12:11
问题 How can I determine the total number of documents in a Solr index using Solrj? After hours of searching on my own, I actually have an answer (given below); I'm only posting this question so others can find the solution more easily. 回答1: Here's what I'm using. Is this canonical? Is there a better way? SolrQuery q = new SolrQuery("*:*"); q.setRows(0); // don't actually request any data return server.query(q).getResults().getNumFound(); 回答2: Your answer of sending the query : is probably the