facet查询语句格式:
f.<FieldName>.<FacetParam>=<value>
f.xxx.xxx=xxx
facet.limit=10
facet.category.facet.limit=5可以覆盖上面定义的10条记录
----------------------------------------------------------------------------------------------------------------------------
Facet参数
http://172.16.1.79:8983/solr/core0/select?q=牛奶&facet=true&facet.query=牛奶&facet.field=cname3&facet.mincount=1
facet.field
facet.prefix
facet.sort 默认按数量排序
facet.limit
facet.offset
facet.mincount
facet.method 取值为enum或fc,默认为fc,表示两种Facet算法。
facet.missing 默认为"",如果设置为true或on,将统计Facet字段值为null的记录。
facet.enum.cache.minDf
Date Facet 时间段分组
facet.date
facet.date.start 2013-01-01T00:00:00Z
facet.date.end 2013-12-31T23:59:59Z
facet.date.gap 时间间隔,设置为+1MONTH表示间隔1个月,分成12个间隔短。
facet.date.hardend start:2012-1-1, end:2012-12-20, gap为1年, 设置为true,结束日期为2013-1-1,设置为false,结束日期为2012-12-20。
facet.date.other
facet.date.include
举例:
&facet=on
&facet.date=date
&facet.date.start=2009-1-1T0:0:0Z
&facet.date.end=2010-1-1T0:0:0Z
&facet.date.gap=%2B1MONTH
&facet.date.other=all
----------------------------------------------------------------------------------------------------------------------------
Facet by Range
facet.range
facet.range.start
facet.range.end
facet.range.gap
facet.range.hardend
facet.range.other
facet.range.include
----------------------------------------------------------------------------------------------------------------------------
echoHandler参数
qt 默认的SolrRequestHandler是/select
wt writer type,默认是xml
NOW
TZ
----------------------------------------------------------------------------------------------------------------------------
q
sort 默认score desc,多个排序以逗号分隔(inStock desc, price asc)
start 默认0
rows 默认10
fq Filter Query,fq=price:[10 TO *]&fq=stock:0 等于 fq=+price[10 TO *] +stock:0
fl 默认*,空格或逗号分隔。id name,price id,name,price
timeAllowed
----------------------------------------------------------------------------------------------------------------------------
Transformers参数
[docid] the lucene document id(int)
[shard] the id of the shard that produced the result
[explain] inline explain info
[explain style=nl|text|html] explain info with explicit style
[value v=? t=int|double|float|date] explicit value
----------------------------------------------------------------------------------------------------------------------------
Field别名
id,price:crazy_price_field 返回crazy_price_field,按price值显示。
id,price:sum(a,b) 返回price,按a+b显示。
fl=my_alias:field_name return field_name but display it as my_alias
----------------------------------------------------------------------------------------------------------------------------
Solr Cookbook学习记录 - Facet学习
最新推荐文章于 2017-07-06 13:29:02 发布