0
votes

The problem is, if the long field has value 120450, 120445, 120656. Please find the query below.

{"from":0,"size":10,"query":{"nested":{"query":{"bool":{"must":[{"querystring":{"query":"120","fields":["alist.articleId"]}}]}},"path":"alist"}}}_

The response should return all the three documents which has partial match for 120. Is it possible to achieve this in long or a numeric field ?

1
@val can you provide your suggestion on the above ? - Muthu

1 Answers

0
votes

For partial matching on numerics, you can store them as string values.

Now, you can use either of the following