本节实例query schema
<fields>
<field name="seq" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="senddatetime" type="date" indexed="fase" stored="true" required="true" multiValued="false" />
<field name="keywords" type="string" indexed="true" stored="true" />
<field name ="mobile" type="string" indexed="true" stored="true"/>
<field name ="description" type="text_general" indexed="true" stored="true"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
</fields>
q
The q
parameter is normally the main query for the request. See Solr query syntax
for more information on different types of queries and syntaxes.
query.setQuery("*:*");
query.setQuery("keywords: \"LP kind 199\"");
query.setQuery("*:* AND NOT seq:a4ec88f8-e0d8-4841-8b02-a88b778d3aa6");
query.setQuery("*:* OR -seq:a4ec88f8-e0d8-4841-8b02-a88b778d3aa6");
sort
query.addSortField("senddatetime", ORDER.desc);
start
query.setStart(0);
rows
query.setRows(20);
pageDoc and pageScore
fq
"fq" stands for Filter Query.
This parameter can be used to specify a query
that can be used to restrict the super set of documents that can be
returned, without influencing score. It can be very useful for speeding
up complex queries since the queries specified with fq are cached
independently from the main query. Caching means the same filter is used
again for a later query (i.e. there's a cache hit). See SolrCaching
to learn about the caches Solr uses.
query.addFilterQuery(" senddatetime:[2012-11-19T00:59:59.999Z TO 2013-03-06T23:59:59.999Z+1YEAR]");
query.addFilterQuery(" senddatetime:[NOW-3MONTHS TO NOW]");
Caching of filters
fl
This parameter can be used to specify a set of fields to return,
limiting the amount of information in the response. When returning the
results to the client, only fields in this list will be included.
query.setFields("keywords description seq");
df
df stands for default search field.
query.setQuery("1316779836");
query.set("df", "mobile");
分享到:
相关推荐
solr查询语法,solr常用查询语法汇总。
solr详细配置教程与solrj的使用
solr-solrj-4.9.0.jar
一个讲解solr配置和应用demo的文档
Solr是一个独立的企业级搜索应用服务器,它对外提供类似于Web-service的API接口。...Solrj 是访问 Solr 的 Java 客户端,它提供添加、更新和查询Solr 索引的接口。http://wiki.chenlb.com/solr/doku.php?id=solrj
排序 / 高亮 / facet / spellcheck:拼写检查 / spatial:空间搜索 / 检索运算符:
solr-solrj-4.4.0.jar
solrJ是Java连接solr进行查询检索和索引更新维护的jar包。
solrj的facet查询总结
压缩文件里面有solr-solrj-4.10.3.jar和solr-solrj-5.0.0.jar两个jar
solr-solrj-6.6.0.jar
主要讲解了 solr客户端如何调用带账号密码的solr服务器调用,实现添加索引和查询索引,以及分组查询
solr-solrj 5.0.0 和自己搭建的solr服务交互
apache-solr-solrj-3.5.0.jar
Solr笔记,Solr笔记,Solr笔记,Solr笔记,Solr笔记,Solr笔记,Solr笔记,Solr笔记,Solr笔记,Solr笔记,
1、站内搜索的技术选型 2、什么是solr 3、solr的安装及配置 Solr整合tomcat 4、使用solr维护索引 a)添加 ...5、使用solr查询索引 6、Solr的客户端SolrJ a)solrJ维护索引 b)SolrJ查询索引 7、综合案例
solr-solrj-4.10.3.jar。
该文档主要是对solr1.4的配置,包含服务器的复制,分发,和分片
solrj工具类封装,包括条件批量查询,批量增删改,分段修改。