Check if index value is substring of input string

I have an index with field and value like(ES_VAL: AMERICAN EXPRESS),
I want to check if the entire ES_VAL is substring of an input string(eg: CANADA AMERICAN EXPRESS).
this is reverse of normal substring operation as we have to check if value in index is substring of input string.

should I use contains on doc[ES_VAL] against input string for this? or is there any solution exists.

thanks for the help!

Hi @rahulkothanath .

Should respect terms order? Look Match Phrase Query.

order matters.
we are looking for reverse of match Phrase Query. want to check value in index is substring of query string but Match Phrase Query checks query string is substring of index value.
eg: Elasticsearch contains field ES_VAL with value AMERICAN EXPRESS and query string parameter is CANADA AMERICAL EXPRESS.

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