Elasticsearch Facets Count返回不同的结果

时间:2014-06-18 16:14:24

标签: elasticsearch facets

当我运行 WA状态

的请求时,我遇到了一个有趣的问题
{   
"query":{"bool":{"must":[ {"query_string":{"default_field":"State","query":"\"**wa**\""}}],"must_not":
            [],"should":[]}},"from":0,"size":10,"sort":[],
        "facets":{ "States" : { "terms" : { "field" : "State" } } }
}

结果

  

" facets":{           "国家":{               " _type":" terms",               "失踪":0,               "总计":78201,               "其他":0,               "条款":[                   {                       " term":" wa",                       "计算":78201                   }               ]           }

但如果我对所有州

运行此请求
{   
"query":{ "bool":{"must":[{"match_all":{}}],"must_not":[],"should":[]}},"from":0,"size":1,"sort":[],
      "facets":{ "States" : { "terms" : { "field" : "State" } } }
}

为WA返回较少的计数,我希望与

之前的查询具有相同的数字
  

" facets":{           "国家":{               " _type":" terms",               "失踪":209814,               "总计":2549592,               "其他":1200206,               "条款":[                   {                       " term":" ca",                       "计算":305780                   },                   {                       " term":" mi",                       "伯爵":185574                   },                   {                       " term":" fl",                       "计算":160341                   },                   {                       " term":" tn",                       "计算":135670                   },                   {                       " term":" il",                       "计算":132751                   },                   {                       " term":" tx",                       "计算":113359                   },                   {                       " term":" oh",                       "计算":98598                   },                   {                       " term":" pa",                       "计算":84601                   },                   {                       " term":" co",                       "计算":79796                   },                   的 {                       " term":" wa",                       "计算":52916                   }               ]           }       }}

那么,弹性研究方面真正有效吗?

一如既往地谢谢

0 个答案:

没有答案