Query_string to find docs field that start with "abc-"?

I have to documents with field value like


I want to just search for docs that start with "abc-" but including the - in the search doesnt work and just search for "abc" will not work as it returns the 3 docs.

I have tried "query": "field:abc" and "field:abc-", is there any way to match online ones that start with "abc-"?

Have you tried using a wildcard? For example, field:abc-*. This might work as long as the field type is keyword or not_analyzed.


using field.keyword:abc-* is what i wanted

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