Solr基础操作12

2022-06-29 22:39:27 浏览数 (2)

Range facets

可以使用区间来进一步分组

facet=true 打开 facet

facet.range=stream_size 以stream_size的分布来分组

f.stream_size.facet.range.start=0 从0开始

f.stream_size.facet.range.end=9000 9000为上限

f.stream_size.facet.range.gap=1000 步进为1000

facet.range.other=after 其它的排最后

代码语言:javascript复制
[root@h102 solr-5.3.0]# curl "http://192.168.100.102:7574/solr/gettingstarted_shard1_replica1/select?q=*:*&wt=json&indent=true&rows=0&facet=true&facet.range=stream_size&f.stream_size.facet.range.start=0&&f.stream_size.facet.range.end=9000&f.stream_size.facet.range.gap=1000&facet.range.other=after"
{
  "responseHeader":{
    "status":0,
    "QTime":41,
    "params":{
      "facet.range.other":"after",
      "f.stream_size.facet.range.start":"0",
      "facet":"true",
      "f.stream_size.facet.range.gap":"1000",
      "f.stream_size.facet.range.end":"9000",
      "indent":"true",
      "q":"*:*",
      "facet.range":"stream_size",
      "wt":"json",
      "rows":"0"}},
  "response":{"numFound":3772,"start":0,"maxScore":1.0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{},
    "facet_dates":{},
    "facet_ranges":{
      "stream_size":{
        "counts":[
          "0",16,
          "1000",61,
          "2000",42,
          "3000",12,
          "4000",591,
          "5000",324,
          "6000",107,
          "7000",265,
          "8000",223],
        "gap":1000,
        "after":2131,
        "start":0,
        "end":9000}},
    "facet_intervals":{},
    "facet_heatmaps":{}}}
[root@h102 solr-5.3.0]#

0 人点赞