0

Can someone please indicate how a custom analyzer should be defined and then used in an ElasticSearch query using the Java API?

I know how to write a custom analyzer to be applied on an index (like here)

but I would like to apply it on a query e.g. to replace the english analyzer in

QueryBuilder matchQuery = matchQuery("content", stringQuery).analyzer("english");

1 Answer 1

0

Custom analyzer is a property of particular field in the index. It's always applied on both query and the indexed data. Set custom analyzer with index settings or a template and it will be used for the query.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.