Closed palak21 closed 4 years ago
Currently, this library doesn't support spatial parameters but adding them is a good idea.
is it possible to amend the URL on the fly and add the spatial parameters till the time we have support for the same?
Hey, It seems SolrQuery class does not have an option to set Spatial parameters. Do you have idea of how we can achieve this? https://lucene.apache.org/solr/6_6_0/solr-solrj/org/apache/solr/client/solrj/SolrQuery.html
According to this thread: https://lucene.472066.n3.nabble.com/Spatial-search-with-SolrJ-3-1-How-to-td2961136.html, we can achive as follows:
solrQuery.setQuery("*:*");
solrQuery.addFilterQuery("{!func}geodist()");
solrQuery.set("sfield", "store");
solrQuery.set("pt", lat + "," + lon);
solrQuery.set("sort", "geodist() asc");
Yup i did same thing and i have added this to your lib have raised pull request please check.
Oh, thanks! Let me see.
Added spatial parameters support in #64.
We are building a solr query using this library. we want to add couple of spatial fields namely sname and pt How do you add spatial parameters to the query builder![image](https://user-images.githubusercontent.com/34096576/70137797-ce57b400-16b4-11ea-84a3-648979445cd4.png)