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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -