我们知道solr提供了一个DIHandler,提供将关系数据库中的数据导成索引,然后使用solr查询. 对于一个大表中关联数个小表的查询,这非常耗费时间. 我的思路是: 1. 将一个大表做成索引,使用solr查询. 2.数据库查询关联小表的数据. 3. 在接口端进行聚合(使用java做聚合) 正在实践中,特此做笔记记住!…
先参考这个吧 http://www.shareditor.com/blogshow/6…
一.SolrJ介绍 1. SolrJ是什么? Solr提供的用于JAVA应用中访问solr服务API的客户端jar.在我们的应用中引入solrj: <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> <version>7.3.0</version> </dependency> 2. SolrJ的核…
一.Java Script 1.由于Solr本身可以返回Json格式的结果,而JavaScript对于处理Json数据具有天然的优势,因此使用JavaScript实现Solr客户端是一个很好的选择. 2.在之前,主要使用SolJS作为solr的客户端,目前主要使用ajax-solr,信息请见:https://github.com/evolvingweb/ajax-solr/wiki/Reuters-tutorial%3A-step-1. 3.以下示例未使用上述所述的客户端,而是使用了ajax的基…
一.SolrJ基础 1.相关资料 API:http://lucene.apache.org/solr/4_9_0/solr-solrj/ apache_solr_ref_guide_4.9.pdf:Client APIs---Using SolrJ http://wiki.apache.org/solr/Solrj solr in action:Using the SolrJ client library to add documents from Java, Using SolrJ from…
1.关于默认搜索域 If you are using the Lucene query parser, queries that don't specify a field name will use the defaultSearchField. The DisMax and Extended DisMax query parsers do not use this value.  Use of the defaultSearchField element is deprecated in S…
一.关于Velocity的基本配置 在Solr中,可以以多种方式返回搜索结果,如单纯的文本回复(XML.JSON.CSV等),也可以返回velocity,js等格式.而VelocityResponseWriter就是用于将返回velocity类型文本,以便直接用于结果呈现. 在Solr提供的example,其中的一个RequestHandler--/browse,使用了VelocityResponseWriter.其配置如下: <requestHandler name="/browse&q…
1.RemoteSolrException: Expected mime type application/octet-stream but got text/html 现象: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.o…
一.向Solr提交索引的方式 1.使用post.jar进行索引 (1)创建文档xml文件 <add> <doc> <field name="id">test4</field> <field name="title">testagain</field> <field name="url">http://www.163.com</field> </d…
转载自:http://blog.csdn.net/vltic/article/details/19917377 (1)相应的开发环境准备          (1)jdk1.6+的安装和环境变量配置(命令行敲java和javac,检验) (2)ant1.8+的安装和环境变量配置(命令行敲ant -v检验) (3)solr4.6.1源代码下载,选择solr-4.6.1-src.tgz http://mirror.bit.edu.cn/apache/lucene/solr/4.6.1/ (2)编译so…