简体   繁体   English

RoR,Tire和Elasticsearch

[英]RoR, Tire and Elasticsearch

Good day, I have a project with elasticsearch and tire gem. 祝您有美好的一天,我有一个与Elasticsearch和Tyre Gem有关的项目。 I have a facet, that returns me letters. 我有一个方面,可以给我回信。

facet "some" do
  terms :letter, :order => 'term', :size => 99999
  facet_filter :term, id: id
end

I have a output of search query like 我有类似的搜索查询输出

{
  "_index": "some",
  "_type": "some",
  "_id": "210",
  "_score": 1,
  "_source": {
  "id": 1,
  "letter": "p"
  }
}

And many more other records. 还有更多其他记录。 It's working nearly ok, but if letter is 'a', facet doesn't want to return it to me. 它几乎可以正常工作,但是如果字母为“ a”,则构面不想将其退还给我。 I think, it pushes it to "missing". 我认为,这将其推向“缺失”状态。

"facets": {
  "fac": {
     "_type": "terms",
     "missing": 27,
     "total": 261,
     "other": 0,
     "terms": [

Sounds like a magic. 听起来像魔术。 Where can be the problem? 问题出在哪里? And how can I look through missing records? 我如何查看丢失的记录? (I'm using Sense extension to work with ES faster) (我使用Sense扩展程序可以更快地与ES配合使用)

As I understood, it had some filter which is removing the letter "a". 据我了解,它有一些过滤器正在删除字母“ a”。 I rewrite method, that returns my first letters, so my new output was "a_letter", "b_letter" etc. and it worked for me. 我重写了方法,该方法返回了我的第一个字母,所以我的新输出是“ a_letter”,“ b_letter”等,并且对我有用。 Thanks @Shadwell for help. 感谢@Shadwell的帮助。

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

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