简体   繁体   中英

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; Rails 3.0.14

It looks like params[:query] is null, whereas elasticsearch is obviously expecting a string.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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