Skip to content

Instantly share code, notes, and snippets.

@ianAndrewClark
Created July 1, 2011 11:32
Show Gist options
  • Save ianAndrewClark/1058355 to your computer and use it in GitHub Desktop.
Save ianAndrewClark/1058355 to your computer and use it in GitHub Desktop.
10 point polygon test, with bounded box
{
"from": 0,
"size": 100,
"facets": {
"outcodes": {
"terms": {
"field": "outcode",
"order": "count",
"size": 5
}
}
},
"query": {
"filtered": {
"query": {
"match_all": {
}
},
"filter": {
"and": [
{
"geo_bounding_box": {
"properties.location": {
"top_left": {
"lat": 53.415485988950735,
"lon": -2.6738965542117406
},
"bottom_right": {
"lat": 53.411449805261,
"lon": -2.6464637484023452
}
}
}
},
{
"geo_polygon": {
"properties.location": {
"points": [
{
"lat": 53.411534648993729,
"lon": -2.667434493185743
},
{
"lat": 53.41186119045917,
"lon": -2.6525994354098024
},
{
"lat": 53.412079431463688,
"lon": -2.6489958326842209
},
{
"lat": 53.414132514895023,
"lon": -2.6464637484023452
},
{
"lat": 53.415485988950735,
"lon": -2.67019552673633
},
{
"lat": 53.414149158540951,
"lon": -2.6714171829120357
},
{
"lat": 53.412681370554104,
"lon": -2.6727584230042036
},
{
"lat": 53.4114558321438,
"lon": -2.6738965542117406
},
{
"lat": 53.411449805261,
"lon": -2.6712754511387913
},
{
"lat": 53.411534648993729,
"lon": -2.667434493185743
}
]
}
}
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment