简体   繁体   English

我无法使用ElasticSearch进行搜索。 轮胎::搜索:: SearchRequestFailed:503

[英]I cannot search with ElasticSearch. Tire::Search::SearchRequestFailed: 503

I have a method for search in model: 我有一个模型搜索方法:

def self.search params
  tire.search do
    query { string params[:query], default_operator: "AND" }
  end
end

in the terminal, I see: 在终端,我看到:

[REQUEST FAILED] curl -X GET "http://localhost:9200/products/product/_search?pretty=true" -d '{"query":{"query_string":{"query":null}}}'
Tire::Search::SearchRequestFailed: 503 : {"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]","status":503}
from /home/naumenko/.rvm/gems/ruby-1.9.3-p550/gems/tire-0.3.12/lib/tire/search.rb:72:in `perform'

I'm using Ruby 1.9.3; 我正在使用Ruby 1.9.3; Rails 3.0.14 Rails 3.0.14

It looks like params[:query] is null, whereas elasticsearch is obviously expecting a string. 看起来params[:query]是null,而elasticsearch显然期望一个字符串。

In addition it looks like you are running a very old version of tire. 此外,看起来你正在运行一个非常旧版本的轮胎。 Even the latest version of tire (which has been retired) doesn't officially support elasticsearch 1.0+ so you may run into additional compatibility problems. 即使最新版本的轮胎(已经退役)也没有正式支持elasticsearch 1.0+,因此您可能会遇到其他兼容性问题。

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

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