0
0
Fork 0

fixed typo and formatted searches.json through jq .

This commit is contained in:
Marty Schoch 2017-03-29 19:33:54 -04:00
parent 7f89ff9493
commit 5636536583
2 changed files with 129 additions and 125 deletions

View File

@ -20,7 +20,7 @@ import (
)
// ExtractGeoPoint takes an arbitrary interface{} and tries it's best to
// interpret it is as geo point. Supportd formats:
// interpret it is as geo point. Supported formats:
// Container:
// slice length 2 (GeoJSON)
// first element lon, second element lat

View File

@ -1,157 +1,161 @@
[
{
{
"comment": "breweries near the couchbase office",
"search": {
"from": 0,
"size": 10,
"search": {
"from": 0,
"size": 10,
"query": {
"location": {
"lon": -122.107799,
"lat": 37.399285
},
"distance": "100mi",
"field":"geo"
"field": "geo"
},
"sort": [
{
"by": "geo_distance",
"field": "geo",
"unit": "mi",
"location":{
"lon":-122.107799,
"lat":37.399285
}
}
]
},
"result": {
"total_hits": 3,
"hits": [
{
"id": "firehouse_grill_brewery"
},
{
"id": "jack_s_brewing"
},
"by": "geo_distance",
"field": "geo",
"unit": "mi",
"location": {
"lon": -122.107799,
"lat": 37.399285
}
}
]
},
"result": {
"total_hits": 3,
"hits": [
{
"id": "firehouse_grill_brewery"
},
{
"id": "jack_s_brewing"
},
{
"id": "brewpub_on_the_green"
}
]
}
},
{
]
}
},
{
"comment": "breweries near the whitehouse",
"search": {
"from": 0,
"size": 10,
"search": {
"from": 0,
"size": 10,
"query": {
"location": {
"lon": -77.0365,
"lat": 38.8977
},
"distance": "100mi",
"field":"geo"
"field": "geo"
},
"sort": [
{
"by": "geo_distance",
"field": "geo",
"unit": "mi",
"location":{
"lon":-77.0365,
"lat":38.8977
}
}
]
},
"result": {
"total_hits": 3,
"hits": [
{
"id": "capital_city_brewing_company"
},
{
"id": "hook_ladder_brewing_company"
},
"by": "geo_distance",
"field": "geo",
"unit": "mi",
"location": {
"lon": -77.0365,
"lat": 38.8977
}
}
]
},
"result": {
"total_hits": 3,
"hits": [
{
"id": "capital_city_brewing_company"
},
{
"id": "hook_ladder_brewing_company"
},
{
"id": "sweet_water_tavern_and_brewery"
}
]
}
},
{
]
}
},
{
"comment": "bounding box of USA",
"search": {
"from": 0,
"size": 10,
"query":{
"top_left":{
"lon":-125.0011,
"lat":49.5904
},
"bottom_right":{
"lon":-66.9326,
"lat":24.9493
},
"field":"geo"
},
"sort": ["name"]
},
"result": {
"total_hits": 6,
"hits": [
{
"id": "brewpub_on_the_green"
},
{
"id": "capital_city_brewing_company"
},
{
"id": "firehouse_grill_brewery"
},
"search": {
"from": 0,
"size": 10,
"query": {
"top_left": {
"lon": -125.0011,
"lat": 49.5904
},
"bottom_right": {
"lon": -66.9326,
"lat": 24.9493
},
"field": "geo"
},
"sort": [
"name"
]
},
"result": {
"total_hits": 6,
"hits": [
{
"id": "hook_ladder_brewing_company"
},
{
"id": "jack_s_brewing"
},
"id": "brewpub_on_the_green"
},
{
"id": "capital_city_brewing_company"
},
{
"id": "firehouse_grill_brewery"
},
{
"id": "hook_ladder_brewing_company"
},
{
"id": "jack_s_brewing"
},
{
"id": "sweet_water_tavern_and_brewery"
}
]
}
},
{
"comment": "bounding box around DC area",
"search": {
"from": 0,
"size": 10,
"query":{
"top_left":{
"lon":-78,
"lat":39.5
},
"bottom_right":{
"lon":-76,
"lat":38.5
},
"field":"geo"
},
"sort": ["name"]
},
"result": {
"total_hits": 3,
"hits": [
{
"id": "capital_city_brewing_company"
},
{
"id": "hook_ladder_brewing_company"
},
{
"id": "sweet_water_tavern_and_brewery"
}
]
}
}
]
}
},
{
"comment": "bounding box around DC area",
"search": {
"from": 0,
"size": 10,
"query": {
"top_left": {
"lon": -78,
"lat": 39.5
},
"bottom_right": {
"lon": -76,
"lat": 38.5
},
"field": "geo"
},
"sort": [
"name"
]
},
"result": {
"total_hits": 3,
"hits": [
{
"id": "capital_city_brewing_company"
},
{
"id": "hook_ladder_brewing_company"
},
{
"id": "sweet_water_tavern_and_brewery"
}
]
}
}
]