I'm trying to write a query to find all data that contains a specific string with dash, for example:
"abcd-ehd".
however, using wildcard abcd-ehd doesnt work because the dash is not translated.
if the data for example is elastic.ebcd-ehd.search, how can i extract it by using wildcard?
(I have tried using a single (*) before and after the strring.)
Welcome!
It mostly depends on your mapping and the analyzer you are using for this field.
BTW In general try to avoid wildcards as this could be very slow.
Knowing the structure of the strings you search for may be you should try to replace the dash with some searchable character. This could be done with a script while indexing the data. A special mapping which takes this transformation in consideration would also be necessary.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.