elasticsearch exclude results with value -
how can perform search excluding results field has specific value?
i have database of reddit comments , want find bitcoin mentions, exclude bitcoin subreddit.
curl -s -xget 'http://localhost:9200/_search?pretty=true&size=100' -d ' { "filtered": { "query" : { "match": { "body": "bitcoin" } }, "filter": { "not": { "term": { "subreddit": "bitcoin" } } } } }'
the error long post here. https://gist.github.com/kylelk/feca416156712eebad3e
it silly error,
you have include filtered query inside query . here modification
post _search { "query": { "filtered": { "query": { "match": { "body": "bitcoin" } }, "filter": { "not": { "term": { "subreddit": "bitcoin" } } } } } }
hope helps!!
Comments
Post a Comment