Hi,
The following query works fine in 1.7.x:
curl -XPOST localhost:9200/dummy/document -d '{
"ids": [1,2,3]
}'
curl -XPOST localhost:9200/dummy/document/_search -d '
{
"query": {
"filtered":{
"query": {"match_all": {}},
"filter": {
"not": {
"and": [
{
"terms": {
"ids": [6]
}
}
]
}
}
}
}
}'
However in ES 2.0.1 and 2.1.1 I get
{"error":{"root_cause":[{"type":"query_parsing_exception","reason":"[_na] query malformed, must start with start_object","index":"dummy","line":11,"col":26}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"dummy","node":"q_wr-wtpSOOgH0NJ9HVI-Q","reason":{"type":"query_parsing_exception","reason":"[_na] query malformed, must start with start_object","index":"dummy","line":11,"col":26}}]}
Using the long form of the and or the not filter seems to be ok: these 2 queries parse ok.
{
"query": {
"filtered":{
"query": {"match_all": {}},
"filter": {
"not": {
"filter":{
"and": [
{
"terms": {
"ids": [6]
}
}
]
}
}
}
}
},
"_source": false
}
or
{
"query": {
"filtered":{
"query": {"match_all": {}},
"filter": {
"not": {
"and": {
"filters":[
{
"terms": {
"ids": [6]
}
}
]
}
}
}
}
},
"_source": false
}
I couldn't find mention of this in the 2.0 breaking changes document - should the first query still work?
Thanks,
Fred