1. 按city分组统计
http://localhost:8983/solr/select?q=name:company
&facet=true
&facet.field=city
&facet.mincount=1
2. 按价格区间分组统计
/select?q=*:*&rows=0
&facet=true
&facet.range=price
&facet.range.start=0
&facet.range.end=400
&facet.range.gap=100
3. 按指定的价格区间分组统计
/select?q=name:car
&facet=true
&facet.query=price:[10 TO 80]
&facet.query=price:[90 TO 300]
4. ???
/select?q=name:company
&facet=true
&fq={!tag=stateTag}state:"New York"
&facet.field={!ex=stateTag}city
&facet.field={!ex=stateTag}state
5. 排序
/select?q=name:house
&facet=true
&facet.field=city
&facet.sort=index
6. facet实现autosuggest,如果是显示suggesting words,而不是显示整个词语,
改变title_autocomplete的类型为solr.TextField,例如text_ws类型。
/select?q=*:*&rows=0
&facet=true
&facet.field=title_autocomplete
&facet.prefix=so
7. 查找solr有关的书,并统计出免费的书推荐给读者。
/select?q=title:solr
&facet=true
&facet.query=!price:[ * TO *]
8. 分组统计2种类型
/select?q=name:car&rows=0
&facet=true
&facet.field=category
&facet.field=manufacturer
&f.category.facet.limit=-1
&f.manufacturer.facet.limit=10
9. 统计某category下有货,无货的书籍
/select?q=*:*&rows=0
&facet=true
&facet.pivot=category,stock
10. ???
/select?q=*:*
&facet=true
&facet.field=stock
&group=true
&group.field=category
&group.truncate=true
&
Solr Cookbook学习记录 - 第五章 Faceting
最新推荐文章于 2014-01-08 13:59:24 发布