curl -X GET "http://localhost:9200/ip/_search?pretty=true" -d
\ (~/workspace/
RestServer/dat)
'{
bool : {
must : {
range : { start: { from :null, to: 15 } }
},
must: {
range : { stop: { from :15, to: null } }
}
}
}'
{
"_shards" : {
"total" : 5,
"successful" : 0,
"failed" : 5
},
"hits" : {
"total" : 0,
"hits" :
}
}%
do not return any result.
match_all returns :
"hits" : {
"total" : 2,
"hits" : [ {
"_index" : "ip",
"_type" : "range",
"_id" : "1", "_source" : {
start: 1511729664,
stop: 1511729919,
location: 210743
}
}, {
"_index" : "ip",
"_type" : "range",
"_id" : "2", "_source" : {
start: 10,
stop: 20,
location: 210743
}
I must be omitting something obvious
On Feb 11, 4:00 pm, Shay Banon shay.ba...@elasticsearch.com wrote:
Your thoughts are correct, you should use a boolean query with (I am
guessing) two must clauses which will return an AND basically of the two
clauses, here is an example:
{
bool : {
must : {
range : { ... }
},
must: {
range : { ... }
}
}
}
-shay.banon
On Thu, Feb 11, 2010 at 4:54 PM, Rabbit antonin.bo...@gmail.com wrote:
Hi,
I'd like to do combined range query on document like
document {
start: 10,
stop: 20
}
Querying using '{ query : { range : {start: { from :null, to:
15 } } }' works fine,
but how to do something like :
'{ query : { range : {start: { from :null, to: 15 } }, stop: { from:
15, to: null} }'
I tried to combine them using boolean query without success.
Any clue ?
Thank you