У меня есть поле lat(of type location)
в моем schema.xml. Следующий URL при попытке через браузер работает:
https://localhost:8983/solr/myCore/select?q=*%3A*&fq={!geofilt%20sfield=lat}&pt=(X,Y)&d=50
Где (X, Y) - координаты контрольной точки, а d - расстояние в километрах.
Я пытаюсь симулировать то же самое через веб-сервис, но он не работает.
Я пытаюсь использовать следующий код:
final SolrQuery query = new SolrQuery();
query.add("fq", "{!geofilt}");
query.add("sfield", "lat");
//Here pt lat is a string and passed as string of format X,Y
query.add("pt", lat);
query.add("d", distance);
//Make a QueryRequest object and pass the query and make a solr url
//with the URL.
//Take the queryResponse object of type QueryResponse
return queryResponse.getResults().getNumFound();
Ожидаемый результат : 2 (как в браузере)
Фактический результат : 0