How should I manage hyphen in my request

I have tried the following but it does not work if I have a hyphen in my id: http://localhost:9200/account/useraccounts/_search?q=id:"* CMRZ*"
when I send <--> then result is

1-CMRZ-121 <--> 1-CMRZ-121

1-CMRZ- <--> 1-CMRZ-121 ,1-CMRZ-165



Thus now i know the problem is with the hyphen. Any way of preventing this such that I get the following answer?

1-CMR <--> 1-CMRA-971,1-CMRZ-121 ,1-CMRZ-165

First, you should rather use the query DSL, where the query is stated in the body of a HTTP request, as this prevents confusion or any requirement to URL encode parts of your query.

Second, can you please provide a fully reproducible example? I have no idea, what a query is, what a stored documents looks like, how your mapping or index configuration looks like. Those are all needed.


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