1

When I tried:

curl -XPOST 'http://localhost:9200/index/type/_search?search_type=scan&scroll=2m' -d '{"query": {"match": {"host":"xxxx"}}}'

I got a scroll_id. Then I issued:

curl -XPOST 'http://localhost:9200/_search/scroll?scroll=1m&scroll_id=......'

but the response contains logs belonging to other host. Why and how to solve it?

Thanks alot

1 Answer 1

1

Try a term query instead of match:

{"query": {"term": {"host":"xxxx"}}}

This would look for the exact value instead of analyzing the value you have for xxxx and a discussion of the differences is: https://www.elastic.co/guide/en/elasticsearch/guide/current/term-vs-full-text.html

If that doesn't work, it could also be that the field is being analyzed, and the mapping would need to be updated as well. Can you share the mapping for the index and type: http://localhost:9200/index/_mapping/type/?pretty ?

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.