Closed that1guy closed 9 years ago
Working on a geo element to the query string now... it looks like the following:
https://localhost:4043/v1/postings?geo[min]=0&geo[max]=5000&geo[coords]=-122.30257,47.44376
Where:
In the query results, the geo values appear as follows:
"options": {
"count": 1000,
"filters": {},
"geo": {
"min": "0",
"max": "1000",
"coords": "-122.30257,47.44376"
},
"sort": {},
"start": 0
}
Implemented a migration to insure index is correct type:
bash init/apply-migrations.sh
https://localhost:4043/v1/postings?geo[min]=0&geo[max]=5000&geo[coords]=122.3750,37.6189
All postings within 5000 meters of SF
All postings within 1000 meters of the Seattle airport with a heading that contains the word "wallet"
Verified - closing
I'm gonna leave this ticket open as it's giving a pretty large definition of query functionality we're aiming for. Let me know if this ticket too large and I can break into smaller tickets.
Just an example of what I'm thinking.. totally up to you.
var params = {
filters: {
mandatory: {
fuzzySearch: {
heading: "bike"
}
}
},
geo: {
min: {0},
max: {1000},
coords: {[
long,
lat
]}
},
sort: {
distance: {[
long,
lat
]}
}
};
$http({
method: 'GET',
url: ENV.postingAPI + utilsFactory.bracketNotationURL(params)
}).then(function (response) {
console.log('here it is', response);
deferred.resolve(response);
}, function (err) {
deferred.reject(err);
});
Sort by distance along with distance in meters is complete... when querying by geo, distance appears as an additional field under "geo"
Example search across multiple categories:
https://localhost:4043/v1/postings?filters[optional][exact][categoryCode]=SAPP,SANT
This enhancement has been shipped. Built new tickets detailing small bugs within this enhancement. Closing.
Just combing over documentation on your Mongoose Middleware (seriously awesome stuff man!)
Today when searching for items internally in htsApp our Mongo query looks like:
Quick breakdown of this query:
2a. The $maxDistance and $minDistance params are increased as the user paginates.
I thought this breakdown might help determine our goal in leveraging your Mongoose Middleware to formulate a geospatial, Elasticsearch-capable, category-intelligent super query! :)
Cheers man!