使用Elasticsearch / Searchkick进行搜索/自动完成工作但现在已经崩溃了

时间:2014-09-11 00:38:46

标签: ruby-on-rails-4 elasticsearch searchkick

我有一个Rails 4.0.2应用程序,它在acts_as_taggable_on标记对象上运行搜索/自动完成。我已经完成了必要的代码注入以使这些标签可搜索,并且搜索工作了一段时间。最近我一直在讨论一些服务器配置,现在这个搜索不再适用于生产。它仍然可以在开发中使用,实际上它也可以在生产控制台中运行。

RAILS_ENV=production RACK_ENV=production rails c
ActsAsTaggableOn::Tag.reindex

没有解决问题,也没有通过rake来解决问题

RAILS_ENV=production RACK_ENV=production rake searchkick:reindex:all

当我尝试访问自动完成的HTTP请求时,我收到状态500内部服务器错误。错误日志读取

Tire::Search::SearchRequestFailed (400 : {"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[pv808XIxTTizZzRjhply7Q][acts_as_taggable_on_tags_production][4]: 
SearchParseException[[acts_as_taggable_on_tags_production][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"fields\":[\"name.autocomplete\"],\"query\":\"test\",\"analyzer\":\"searchkick_autocomplete_search\"}},\"size\":10,\"from\":0,\"fields\":[]}]]]; nested:
QueryParsingException[[acts_as_taggable_on_tags_production] [multi_match] analyzer [searchkick_autocomplete_search] not found]; }{[pv808XIxTTizZzRjhply7Q][acts_as_taggable_on_tags_production][3]: 
SearchParseException[[acts_as_taggable_on_tags_production][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"fields\":[\"name.autocomplete\"],\"query\":\"test\",\"analyzer\":\"searchkick_autocomplete_search\"}},\"size\":10,\"from\":0,\"fields\":[]}]]]; nested:
QueryParsingException[[acts_as_taggable_on_tags_production] [multi_match] analyzer [searchkick_autocomplete_search] not found]; }{[pv808XIxTTizZzRjhply7Q][acts_as_taggable_on_tags_production][2]: 
SearchParseException[[acts_as_taggable_on_tags_production][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"fields\":[\"name.autocomplete\"],\"query\":\"test\",\"analyzer\":\"searchkick_autocomplete_search\"}},\"size\":10,\"from\":0,\"fields\":[]}]]]; nested: 
QueryParsingException[[acts_as_taggable_on_tags_production] [multi_match] analyzer [searchkick_autocomplete_search] not found]; }{[pv808XIxTTizZzRjhply7Q][acts_as_taggable_on_tags_production][1]: 
SearchParseException[[acts_as_taggable_on_tags_production][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"fields\":[\"name.autocomplete\"],\"query\":\"test\",\"analyzer\":\"searchkick_autocomplete_search\"}},\"size\":10,\"from\":0,\"fields\":[]}]]]; nested: 
QueryParsingException[[acts_as_taggable_on_tags_production] [multi_match] analyzer [searchkick_autocomplete_search] not found]; }{[pv808XIxTTizZzRjhply7Q][acts_as_taggable_on_tags_production][0]: 
SearchParseException[[acts_as_taggable_on_tags_production][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"fields\":[\"name.autocomplete\"],\"query\":\"test\",\"analyzer\":\"searchkick_autocomplete_search\"}},\"size\":10,\"from\":0,\"fields\":[]}]]]; nested: 
QueryParsingException[[acts_as_taggable_on_tags_production] [multi_match] analyzer [searchkick_autocomplete_search] not found]; }]","status":400}):

我已经尝试了我知道怎么做的一切,包括重新启动elasticsearch,重新索引,重新索引所有,删除索引和重新索引,似乎没有任何工作,现在我不知所措。我错过了一些明显的东西,或者有人看到可能出错的东西吗?最大的谜团是,直到最近,这一切都用于生产,我没有改变任何代码!

编辑:如果有帮助,我也会为我的User记录进行搜索/自动填充,但那些仍然可以正常生产......

1 个答案:

答案 0 :(得分:0)

我也遇到了这种类型的错误,我已经重新安装了弹性搜索,请试试这个