Java API substring search query

Hi everyone.
Elasticsearch question about JAVA API:

I have a string (36 characters) where only last 8 characters are different (other chars are prefix) and therefore I want to do search query over these last 8 characters (elasticsearch must ignore the prefix in search time and look for the last chars only).
I don't want to use "wildcard query" approach, because it slows down search.

what is the best way to do it?

It's not a question related to the java api but to elasticsearch.

It's better if you can extract the meaningful text at index time (index only the part you need).

Thank you Mr Pilato
I did same already.
But its possible sometimes user does not have access to the data at the indexing time and have to search on provided documents. so I think it should be better if a client API explicitly exist for this scenario.
Anyway, it seems that your solution is the best choice. :pray:

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