欢迎投稿

今日深度:

solr检索,

solr检索,


搜索是通过select URL上的HTTP GET加一系列带q参数的查询字符串来完成的,即[url]http://localhost:8983/solr/select?[/url]加q参数,例子如下:
[size=small][b]1.查询数据[/b][/size]
查询包含video字符串的记录,只显示name和id字段
q=video&fl=name,id
(即在web浏览器地址栏上输入[url]http://localhost:8983/solr/select?q=video&fl=name,id[/url])
同上,
q=video&fl=*,score

q=video&wt=json
(返回JSON格式的结果)
[size=small][b]2.排序[/b][/size]
q=video&sort=price desc

q=*:*&sort=inStock asc,price desc

[size=small][b]3.高亮显示[/b][/size]
查询video card并且高亮显示name,features字段中的video字符串
q=video card&fl=name,id&hl=true&hl.fl=name,features

[size=small][b]4.层面查询[/b][/size]
q=*:*&facet=true&facet.field=cat

q=*:*&facet=true&facet.field=cat&facet.field=inStock

查询ipod价格在0-100区间的 和 100- 区间的:
q=ipod&facet=true&facet.query=price:[0 TO 100]&facet.query=price:[100 TO *]

也可以按日期查询,查询manufacturedate_dt字段2004至2010年间每一年的数量:
q=*:*&facet=true&facet.date=manufacturedate_dt&facet.date.start=2004-01-01T00:00:00Z&facet.date.end=2010-01-01T00:00:00Z&facet.date.gap=+1YEAR

www.htsjk.Com true http://www.htsjk.com/solr/34016.html NewsArticle solr检索, 搜索是通过select URL上的HTTP GET加一系列带q参数的查询字符串来完成的,即[url]http://localhost:8983/solr/select?[/url]加q参数,例子如下: [size=small][b]1.查询数据[/b][/size] 查询包含vi...
相关文章
    暂无相关文章
评论暂时关闭