Its a bug in the non "filter" wrapping option in not filter, opened an
issue: Query DSL: not filter with inner filter that uses array element fails (without the `filter` wrapper) · Issue #1987 · elastic/elasticsearch · GitHub.
On Tue, May 29, 2012 at 3:09 PM, Frederick Cheung <
frederick.cheung@gmail.com> wrote:
On May 29, 1:41 am, Andy Wick andyw...@gmail.com wrote:
Trying to add simple NOT capability to my elasticsearch interaction and
I'm
getting strange errors from using NOT outside of an OR statement, which I
think I'm using correctly from the documentation.Add just 1 document, no special mapping
curl -XPOSThttp://localhost:9200/tests/test/1-d '{v1:"test1",
v2:"test2"}'
- My normal OR works ok
curl -XPOSThttp://localhost:9200/tests/test/_search-d ' {"query": {
"filtered": {"query": {"match_all": {}},
"filter": {or: [{"term": {"v1": "test1"}}]}
} } }'
- Wrap OR with NOT and get an error
curl -XPOSThttp://localhost:9200/tests/test/_search-d ' {"query": {
"filtered": {"query": {"match_all": {}},
"filter": {"not": {"or": [{"term": {"v1": "test1"}}]}}
} } }'Bug? or are you not allowed to NOT certain things?
I've found i\ve needed to do
"filter": {"not": {"filter": {"or": [...]}}}
But I'm not sure why this is needed.
Fred