前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Solr基础操作11

Solr基础操作11

作者头像
franket
发布2022-06-29 22:37:56
2660
发布2022-06-29 22:37:56
举报
文章被收录于专栏:技术杂记

- 前缀代表必须不包含指定关键字

代码语言:javascript
复制
[root@h102 solr-5.3.0]# curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=%2Btwo+-three"
{
  "responseHeader":{
    "status":0,
    "QTime":15,
    "params":{
      "fl":"id",
      "indent":"true",
      "q":"+two -three",
      "wt":"json",
      "rows":"3"}},
  "response":{"numFound":118,"start":0,"maxScore":0.33085516,"docs":[
      {
        "id":"/data/solr/solr-5.3.0/docs/solr-analytics/org/apache/solr/analytics/expression/package-use.html"},
      {
        "id":"/data/solr/solr-5.3.0/docs/solr-analytics/org/apache/solr/analytics/expression/package-summary.html"},
      {
        "id":"/data/solr/solr-5.3.0/docs/solr-core/org/apache/solr/search/function/distance/package-summary.html"}]
  }}
[root@h102 solr-5.3.0]#

Note: 所谓的不包含并不是绝对的,比如不包含 one 但可以包含 none ,结果取决于分词算法


Faceting

Field facets

信息分组统计

rows=0 不打印出检索结果

facet=true 打开 facet

facet.field=stream_size 设定 stream_size 为聚合对象

代码语言:javascript
复制
[root@h102 solr-5.3.0]# curl "http://192.168.100.102:7574/solr/gettingstarted_shard1_replica1/select?q=*%3A*&wt=json&indent=true&rows=0&facet=true&facet.field=stream_size"
{
  "responseHeader":{
    "status":0,
    "QTime":131,
    "params":{
      "facet":"true",
      "indent":"true",
      "q":"*:*",
      "facet.field":"stream_size",
      "wt":"json",
      "rows":"0"}},
  "response":{"numFound":3772,"start":0,"maxScore":1.0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{
      "stream_size":[
        "4812",22,
        "4823",20,
        "4779",19,
        "4867",18,
        "4790",17,
        "4768",16,
        "4834",16,
        "4746",15,
        "4801",15,
        "4878",15,
        "4920",14,
        "4757",13,
        "4986",13,
        "4724",12,
        "4856",12,
        "4931",12,
        "4964",12,
        "5008",12,
        "5030",12,
        "5063",12,
        "4735",11,
        "4942",11,
        "4975",11,
        "4997",11,
        "4702",10,
        "4845",10,
        "4854",10,
        "4865",10,
        "5094",10,
        "4889",9,
        "5019",9,
        "2737",8,
        "4777",8,
        "4843",8,
        "4900",8,
        "4911",8,
        "4944",8,
        "4953",8,
        "4966",8,
        "2900",7,
        "4821",7,
        "4887",7,
        "4909",7,
        "5041",7,
        "5118",7,
        "5140",7,
        "8989",7,
        "4799",6,
        "4810",6,
        "4832",6,
        "4922",6,
        "4933",6,
        "5017",6,
        "5127",6,
        "5149",6,
        "4691",5,
        "4898",5,
        "5032",5,
        "5052",5,
        "5072",5,
        "5083",5,
        "5162",5,
        "4658",4,
        "4680",4,
        "4713",4,
        "4876",4,
        "4955",4,
        "4977",4,
        "5039",4,
        "5096",4,
        "5105",4,
        "5138",4,
        "5151",4,
        "5173",4,
        "5246",4,
        "5294",4,
        "7305",4,
        "3941",3,
        "4744",3,
        "4788",3,
        "4962",3,
        "5010",3,
        "5050",3,
        "5129",3,
        "5160",3,
        "5184",3,
        "5204",3,
        "5213",3,
        "5224",3,
        "5279",3,
        "6294",3,
        "7523",3,
        "7549",3,
        "7618",3,
        "7983",3,
        "8109",3,
        "9276",3,
        "13358",3,
        "1334",2,
        "1377",2]},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_heatmaps":{}}}
[root@h102 solr-5.3.0]# 

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Faceting
    • Field facets
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档