Elasticsearch 1.7.3 & query_string

My client is still using ES 1.7.3. I ran the following query against it and couldn't get the expected result. ES is running on a Linux Mint 18.3 cinnamon 64 bit version.

curl -XPOST 'localhost:9200/_search?pretty' -d '
{  
   "query_string":{  
      "query":"design"
   }
}'

instead the following errors was thrown.

{
  "error" : "SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[vZBMeFPPTAWvPKpCJyns_Q][cinch][0]: SearchParseException[[cinch][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n\"query_string\":{\n\"query\":\"design\"\n}\n}]]]; nested: SearchParseException[[cinch][0]: from[-1],size[-1]: Parse Failure [No parser for element [query_string]]]; }]",
  "status" : 400
}

Any idea what's wrong with the above query?

Thank you for your help.

You are missing the query field before query_string.

BTW this version is too old.

David:

Yes, that did the magic; thank you.

You said "BTW this version is too old.", I agree. I always try to work with the latest ES. Currently my projects are all on 6.1. I can't blame this on my client though. My client's service provider is not upgrading to a higher version of ES.

Tell your client that he should consider cloud.elastic.co! :wink:

I'm sure you could take this as a business opportunity. dotCMS is an open source content management system that uses ES to index the content. My client is using dotCMS's enterprise service for their content management, indexing, and searching. You may like to approach dotCMS with a proposal. I have already made some suggestions on that but they are deeply buried in their own day to day operations.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.