acts_as_taggable_on
我有一个 Rails 4.0.2 应用程序,它在标签对象上运行搜索/自动完成。我已经完成了必要的代码注入以使这些标签可搜索,并且搜索工作了一段时间。最近我一直在琢磨一些服务器配置,现在这个搜索不再适用于生产。它仍然可以在开发中使用,实际上它也可以在生产控制台中使用。
RAILS_ENV=production RACK_ENV=production rails c
ActsAsTaggableOn::Tag.reindex
不能解决问题,也不能通过 rake via
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
记录进行搜索/自动完成,但这些在生产中仍然可以正常工作......