Debugging elasticsearch

I use tires and elasticsearch. The service started using port 9200. However, it returned 2 errors:

"org.elasticsearch.search.SearchParseException: [countries][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"name:"}}}]]" 

and

 "Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse 'name:': Encountered "<EOF>" at line 1, column 5." 

So, I reinstalled elasticsearch and the service container. Service starts fine.

Now, when I perform a search using the bus, I do not get any results when the results appear, and I do not receive any error messages.

Does anyone know how I can find out what is wrong, not to mention this?

+1
source share
1 answer

First of all, you do not need to reindex anything in normal cases. It depends on how you installed and configured elasticsearch, but when you install and upgrade, for example. With Homebrew, data is saved safely.

Secondly, you do not need to reinstall everything. The error you see only means what it says about the gesture: SearchParseException , i.e. Your request is invalid:

 {"query":{"query_string":{"query":"name:"}}} 

Please note that you did not pass a single query string for the name qualifier. You need to pass something, for example:

 {"query":{"query_string":{"query":"name:foo"}}} 

or, in terms of Ruby:

 Tire.index('test') { query { string "name:hey" } } 

See this update for the Railscasts episode on the bus for an example of how to catch errors due to incorrect Lucene requests.

+11
source

All Articles