Solr Cookbook学习记录 - 第五章 Faceting

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
&

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值