8

I have an index in elasticsearch (tire) with an array field and custom analyzer for ngram with min_ngram = 1 and max_ngram = 10.

Field example

field1: [foo, bar, bof]

I construct a query with value of the field1 'f' and it returns the documents containing 'f' in one of the value in field1.

Question: Is is possible to return only matching values in array, e.g. in case of field1 and query 'f', only 'foo' and 'bof' will be return and 'bar' will be ommited, e.g. field1: [foo, bof]?

1
  • I have the same problem. Did you managed to find a solution? Commented Nov 21, 2014 at 14:35

1 Answer 1

0

You can achieve that applying highlighter in the elastic search query. where in the response you will get extra highlight field with only matched values.

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.