简体   繁体   English

使用轮胎宝石进行弹性搜索的刻面尺寸

[英]Facet size using tire gem for elasticsearch

I am a newbie to elasticsearch. 我是Elasticsearch的新手。 I was trying to create facets using tire gem for my web application. 我试图使用轮胎宝石为我的Web应用程序创建构面。 But I was only able to create 7 entries to any facet. 但是我只能为任何一个方面创建7个条目。 Is there a way that I can manipulate the size of facet in tire gem for elasticsearch? 有什么方法可以操纵轮胎宝石中的刻面大小以进行弹性搜索?

query: 查询:

{
  "query": {
    "bool": {
      "should": [
        {
          "range": {
            "rank": {
              "lte": 50
            }
          }
        }
      ]
    }
  },
  "sort": [
    {
      "rank": "asc"
    }
  ],
  "facets": {
    "univ": {
      "terms": {
        "field": "state_id",
        "size": 50,
        "all_terms": false
      }
    }
  },
  "size": 5
}

You can add a size to the facet: 您可以为构面添加尺寸:

facet 'countries' do
    terms : countries, size: 15
    facet_filter :and, search_filter  unless search_filter.empty?
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM