Skip to content

Commit

Permalink
Adding basic (non-geo) location search to ES search functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Creeger committed Aug 15, 2011
1 parent eb2fc2d commit 34b70f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion grails-app/controllers/org/cafeCentro/EventController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class EventController {
}

private def performSearchUsingElasticSearch(q,location,offset, max) {
Map searchResults = Event.search(q.encodeAsElasticSearchQuery(),[offset:offset,max:max,sort:"date"])
def esQuery = q ? q.encodeAsElasticSearchQuery() : ""
def locationQueryString = location ? " venue.city:(${location.encodeAsElasticSearchQuery()})" : ""
esQuery += locationQueryString

Map searchResults = Event.search(esQuery,[offset:offset,max:max,sort:"date"])

return [results:searchResults.searchResults, totalCount:searchResults.total]
}
Expand Down

0 comments on commit 34b70f7

Please sign in to comment.