Install the solr plugin for Grails using 'grails install-plugin solr' and enable Solr indexing for your domain class by:
static enableSolrSearch = true
static solrAutoIndex = true
Next, we need to add a Solr index field annotation to the domain members.
//import org.grails.solr.Solr
@Solr(field="latitude_rad_d")
Double latitude
@Solr(field="longitude_rad_d")
Double longitude
Once we have those in place, we can use SolrService to query:
getSpatialQuery(query, lat, lng, range)
2 comments:
thank you. I was hunting for this.
Does anybody know if it is possible to have two different datasources being one of them solr?
Post a Comment