0

I'm running the following select query to find a restaurant in a certain area using Solr:

{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
  "q":"name:\"Sushi Hiro\"",
  "pt":"51.048688,-114.0778858",
  "d":"0.2",
  "fl":"*,score",
  "fq":"{!geofilt sfield=location}",
  "rows":"10000000",
  "wt":"json",
  "debugQuery":"true"}},
  "response":{"numFound":1,"start":0,"maxScore":11.842687,"docs":[
  { .... } 

However, Solr only returns the most similar document and it doesn't show me the rest. So what I want is to get at least 2 more documents which are also similar to my query. How can I modify the score threshold to get more results ?

1 Answers1

0

There is no such thing as a "score threshold" - the documents returned are those that match your query. Those that haven't been included does not match the terms you've given in your query, in which you way what the requirements to be included in the query is.

In your example I guess the issue is that you're asking for documents located within 200m of the position given (d=0.2), and there is only one document within range that can be included.

If you want to sort (or boost) by the distance instead of limiting the results to those that are close by, take a look at spatial search and geodist.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
  • Thanks MatsLindh for your answers!, So in my case I want to have a distance filter around a point object and then sort its' adjacent objects(the ones that fall in that area) based on their textual similarity of their names(which is a textual field). But the problem is that Solr only returns the most similar object and it doesn't show the others. What I want is to be able to see all the adjacent objects with their score(which is only based on their names similarity). – nima miryeganeh Aug 14 '18 at 17:17
  • If you want _everything_ close by, regardless of their name (but those with a good match scored higher), don't use a regular query. Use a boost query (`bq`) as the search query, and let the regular query be `q=*:*` - that way you retrieve all documents, but you boost those that match the name. You can also use the `geofilt` as a boost, but you'll have to decide the weights between those two factors yourself in that case. – MatsLindh Aug 14 '18 at 17:21