Uttkarsh Jain
Uttkarsh Jain

Reputation: 228

How to set Spatial parameters in SoleQuery.java of com.github.takezoe.solr.scala

We need to set spatial fields like pt, field, and d programmatically. we are using solr library 7.1.0. Looking at the SolrQuery class methods it seems it doesn't have any support to enable spatial query and add spatial parameters. Here is the parameter list which I want to set in my query. Any idea how I can achieve this?

enter image description here

Upvotes: 0

Views: 28

Answers (1)

MatsLindh
MatsLindh

Reputation: 52902

You should be able to use solrQuery.set("fieldname", "value") to supply custom parameters:

solrQuery.set("pt", "-34...");
solrQuery.set("sfield", "location");

These can also usually be given in your query if you're using {!geofilt or similar: {!geofilt sfield=location}.

Upvotes: 1

Related Questions