Search for a string within a specific field


(gearoid houston) #1

Hi,

In dev tools, how do I search for documents in the 'example' index where the 'test' field contains the string 'abc'. The field will consist of other characters but must contain 'abc'.

Thanks


(Thomas Neirynck) #2

hi @ghouston10,

seems similar to this question: Search for a substring within a specific field

you can use the lucene syntax here.

GET /example/_search?q=test:abc*

For more advanced matching, you can look at the regexp matcher. See here for details: https://www.elastic.co/guide/en/elasticsearch/guide/current/_wildcard_and_regexp_queries.html


(system) #3

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