solrj

Difference between solr core & solrj & spring-data-solr

♀尐吖头ヾ 提交于 2019-12-11 12:38:18
问题 I have been trying to learn solr for implementing search for one of the application. There are three different libraries that i always bump into solr-core , solrj , and spring-data-solr what is the basic difference between three three jar and which is supposed to be used with spring? Recently i tried using solrj and solr-core with spring and got an StackOverflowException here is my question that resulted in stack overflow.Unable to find a solution i tried removing solr-core dependency and

How to compare two columns using Solr?

*爱你&永不变心* 提交于 2019-12-11 12:13:32
问题 Compare two columns in solr if two fields are equal display true or else false. CASE WHEN o_is_follow = o_follow_id THEN 'TRUE' ELSE 'FALSE'. 回答1: As per as I know comparing one field to another within a document is not supported in either Solr . I think it can be achieved by one option of creating another field while indexing only. You can have another field (boolean) . Make this field as boolean type and can be used while searching. Create a o_is_follow_present field and set it to true for

Solrj formats my dates from UTC to CEST

我们两清 提交于 2019-12-11 11:28:22
问题 I just discovered a problem with a date field in my application. I have a date field that is indexed in Solr in UTC format. For instance, "parution_date": "2014-09-29T22:00:00Z", . When I make request to Solr using a pivot, and I want to get this value, Solr converts my date to CET (I'm in Europe). Here the date I received for the same document: Tue Sep 30 00:00:00 CEST 2014 . As you see here, instead of keeping the date to its original format which is UTC, it converts the date CEST. I want

can not create CoreContainer in solrj and embeddedsolrserver in java

。_饼干妹妹 提交于 2019-12-11 10:42:31
问题 This is my Code, I am very tired to create CoreContainer File home = new File( "C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/solr" ); //home directory File f = new File(home, "solr.xml" ); CoreContainer container = new CoreContainer(); container.load( "C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/solr", f ); EmbeddedSolrServer server = new EmbeddedSolrServer( container, "collection1" ); SolrQuery query = new SolrQuery("*:*"); QueryResponse rsp = server

全文检索可视化动态管理(二)--solr二次开发和solrj扩展

我的未来我决定 提交于 2019-12-11 10:11:19
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 要完成solr的索引动态配置,需要solr提供动态新建、修改配置等的接口。solr虽提供core的添加删除,但不提供schema.xml修改新建接口,并且如果添加一个新core,也要将另一个core的conf配置文件复制一份到新的core文件夹下,然后管理页载入新的core。因此需要二次开发。 查看solr的web.xml,可以发现请求链接都进入org.apache.solr.servlet.SolrDispatchFilter。查看SolrDispatchFilter源码,可以在doFilter方式里看到,如果是adminPath的链接,则SolrRequestHandler的实现是cores.getMultiCoreHandler()。 进入getMultiCoreHandler()方法,可以得知是org.apache.solr.handler.admin.CoreAdminHandler。此类则是solr管理界面的Core Admin的接口处理类。因此,可以继承CoreAdminHandler,重载handleRequestBody方法来给solr增加所需的处理接口。 进一步查看源码,可以发现solr.xml里可以用adminHandler标签替换CoreAdminHandler。solr.xml: <

solr ReplicationHandler - SnapPull failed to download files

吃可爱长大的小学妹 提交于 2019-12-11 09:29:07
问题 we are continuously getting this exception during replication from master to slave. our index size is 9.7 G and we are trying to replicate a slave from scratch. 30 Oct 2013 18:22:16,996 [explicit-fetchindex-cmd] ERROR ReplicationHandler - SnapPull failed :org.apache.solr.common.SolrException: Unable to download _41c_Lucene41_0.doc completely. Downloaded 0!=107464871 at org.apache.solr.handler.SnapPuller$DirectoryFileFetcher.cleanup(SnapPuller.java:1266) at org.apache.solr.handler.SnapPuller

Missing mandatory unique key field error in SolrJ

廉价感情. 提交于 2019-12-11 07:33:27
问题 I've this issue in my project. I read my .xlsx excel file using Apache Poi and I want to index them in my Solr core. I use SolrInputDocument to index reading file. Here is my java codes package org.solr; import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import java.io.File; import java.io

Solrj Block Join Bean support

本秂侑毒 提交于 2019-12-11 05:48:14
问题 I would like to use a Solrj Bean to save/query nested documents from Solr. Is this possible? I see that since version 4.5 it is possible to use addChildDocument(SolrInputDocument child) but looking at the source code for org.apache.solr.client.solrj.beans.DocumentObjectBinder I see that nested documents are not taken into consideration. A new annotation additional to the @Field annotation would also be required I guess. Does anyone have any experience with this? 回答1: If you want to insert

Using solrj to retrieve a SolrDocument in json format

こ雲淡風輕ζ 提交于 2019-12-11 02:32:21
问题 How do I specify the SolrQuery to return the data in json format? Heres the code I am using to query data: Once I get the SolrDocument how can I convert it to a json Object/string? SolrQuery sQuery = new SolrQuery(); sQuery.setQuery("name:test"); QueryResponse resp = server.query(sQuery); SolrDocumentList docs = resp.getResults(); 回答1: SolrJ is designed to retrieve/convert the document as your defined POJO. If you want to convert the document to JSON, you would need to use a library like

Which jars are needed to use ConcurrentUpdateSolrServer?

不问归期 提交于 2019-12-11 01:35:13
问题 Currently using solrServer = new CommonsHttpSolrServer(serverUrl); and with these jars.. apache-solr-core-3.6.0 apache-solr-solrj-3.6.0 commons-codec-1.6 commons-httpclient-3.1 commons-io-2.1 jcl-over-slf4j-1.6.1 slf4j-api-1.6.1 slf4j-jdk14-1.6.1 lucene-core-3.5.0 However apache solr deprecated CommonHttpSolrServer and suggested ConcurrentUpdateSolrServer Replacing CommonHttpSolrServer by ConcurrentUpdateSolrServer gives runtime exception .. Exception in thread "main" java.lang