Hello,
I am using ES-1.5.0. I can't for the life of me figure this out. I am
trying to do a simple filter query, like so:
{
"filter": {
"bool" : {
"must" : [
{"term": {"sentiment": "negative"}}
]
}
}
}
which returns something like:
{"took":7,"timed_out":false,"_shards":
{"total":5,"successful":5,"failed":0},
"hits":
{"total":1249,"max_score":1.0,
"hits":[{"_index":"myIndex","_type":"myType","_id":"92","_score":1.0,"_source":
{"topic":"Topic_4",
"sentiment":"negative"}}...
I highlighted the relevant bits. We can see it indeed filters only on
"negative" terms in the "sentiment" field. Now, when I try filtering only
for "Topic_4" in the "topic" field:
{
"filter": {
"bool" : {
"must" : [
{"term": {"topic": "Topic_4"}}
]
}
}
}
I get an empty array back:
{"took":2,"timed_out":false,"_shards":
{"total":5,"successful":5,"failed":0},
"hits":
{"total":0,"max_score":null,
"hits":[]}}
Even though we know "Topic_4" exists and my query syntax was identical.
Both fields are also mapped to strings. This is also true for any term I
try in the "topic" field.
Also, the reason I am using a boolean filter is because I eventually want
to find items that both have a certain topic and sentiment.
Any help would be greatly appreciated as I really have no idea what's going
on.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/35d8583a-9fdf-4337-86c1-3a7a448fc847%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.