On 1/3/2018 6:16 PM, Deepak Udapudi wrote:
Assume that, I am searching for car care centers. Solr collection has the data
for all the major car care centers. As an example I search for Firestone car
care centers in a 5 miles radius. In the search results I am supposed to
receive the firestone car care centers list within 5 miles from the specified
location and the centers should be sorted in distance order.
In the solr query handler I have specified the following.
i) I have specified the query condition (q) to be based on
distance parameter (basically search for records within a certain distance in
miles).
ii) I have specified the filter query conditions (fq) where
fields accepting general text are matching free text input (for ex :- Firestone
Carcare)
These should probably be the other way around -- so the q parameter
contains the user provided query and the distance is a filter. It's
more in line with the way I expect things to be done, and it would
probably result in more efficient performance of the filterCache. Also,
filter queries do not affect the score -- at all. So you're not getting
any relevance information from the query that your user is typing.
I don't know very much about spatial, but there is a lot of
documentation I can read.
iii) I have specified the sort condition(sort ) to be based on
score(calculated based on the filter query (fq) conditions applied in the 2nd
item in the list) and distance. If there are duplicate records matching by
score, then distance should be used to order the duplicate records.
Can you provide the entry from solr.log that shows the full query
request? Below is the kind of log entry I am talking about. This was
obtained by going to the admin UI query tab, typing in "example query",
and then executing that query.
2018-01-04 13:10:03.042 INFO (qtp1394336709-1102402) [ x:ncmain]
o.a.s.c.S.Request [ncmain] webapp=/solr path=/select
params={q=example+query&indent=on&wt=json&_=1515071388516} hits=2163
status=0 QTime=4473
Thanks,
Shawn