Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

type=search_phase_execution_exception, reason=all shards failed when i send '/'

I’m using elasticSearch with RestHighLevelClient and Java. When I put query:
QueryBuilder qb = new QueryStringQueryBuilder("" + valueSearch.toLowerCase() + ""). Where valueSearch contain "/" -> example REC2/. The searchResponse = client.search(searchRequest, RequestOptions.DEFAULT) return me Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed].
However, when I send Rec2/2/3 or Rec// everything its ok.

Version elastic: 7.3.0

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The query_string query has some reserved characters that you’re now allowed to use in queries (such as /), except if properly escaped.

So you should escape all reserved characters that are present in valueSearch.toLowerCase()

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading