Hi there,

Through SolrJ 3.2, I'm trying to set some Spatial Search queries (e.g., filter 
by distance, sort by distance, etc.). I don’t know whether there's a specific 
SolrJ syntax to do this. I tried using Strings, but it’s not working. Here’s 
are two examples that work fine on Solr, but don’t work when I use SolrJ:

Example 1:

        …

        String q = "{!func}geodist()&sfield=store&pt=” + lat + “,” + lon 
+”&sort=score asc";

        SolrQuery solrQuery = new SolrQuery();

        solrQuery.setQuery(q);

        … 

Using SolrJ, I get the following error.

        …

        org.apache.lucene.queryParser.ParseException: geodist - not enough 
parameters:[]  


Example 2:

        …

        String q = "*:*&sfield=store&sort=geodist() asc&pt=” + lat + “,” + lon;

        …

Using SolrJ, I get the following error

        …

        Caused by: org.apache.solr.common.SolrException: undefined field *



Do you know how to set these kinds of queries using SolrJ?
Thanks in advance for your help,

-S

Reply via email to