Created
January 20, 2016 16:18
-
-
Save rishiloyola/a6f4ae25e8db6c0ea9d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.getSuggestions = function(text) { | |
return appbaseRef.search({ | |
index: 'checkin', | |
body: { | |
suggest: { | |
mysuggester: { | |
text: text, | |
completion: { | |
field: 'city_suggest' | |
} | |
} | |
} | |
} | |
}); | |
} | |
this.getSearchCheckin = function(text) { | |
return appbaseRef.search({ | |
index: 'checkin', | |
type: 'city', | |
body: { | |
query: { | |
match: { | |
city: text | |
} | |
} | |
} | |
}); | |
} | |
this.getliveData = function() { | |
return appbaseRef.searchStream({ | |
type: 'city', | |
body: { | |
query: { | |
match_all: {} | |
} | |
} | |
}); | |
} | |
this.getDragData = function(lat, lng) { | |
return appbaseRef.search({ | |
type: 'city', | |
body: { | |
query: { | |
filter: { | |
geo_distance: { | |
distance: "2000km", | |
location: [lat, lng] | |
} | |
} | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment