Double facets


(pere roca ristol) #1

hi, I want to to group all the data that share exactly the same location
(same latitude and longitude fields).

I tried something like this, without success

curl -XGET http://www.my_server:9200/idx_occurrence/Occurrence/_search?pretty=true -d '{
"query": {
"query_string" : {
"fields" : ["genus_interpreted","dataset"],
"query": "Pica 2",
"default_operator" : "AND"
}
},
"facets": {
"test": {
"terms": {
"fields" :["decimalLatitude","decimalLongitude"],
"size" : 500000000
}
}
}
}'

I think the best way would be to add a new fields in data:
latittude_longitude and simply do a facet against it, but for me is now a
little complicated to change the data.

It seems like Script
(http://www.elasticsearch.org/guide/reference/query-dsl/script-filter.html)
could help but I am not able to figure out how to get it work (and not
fully understand how to structure the idea, honestly)

thanks in advance,

Pere

--


(system) #2