I have a CakePHP 1.3 application connecting to Solr 3.3 search.
There are two documents with the same attributes except for their lat/lon. The doc with closer lat/lon was entered second (higher id) but with the bost from geodist() I expect it to appear first. Actual behavior is doc with closer lat/lon appears second. Here’s the array the PHP Solr service hands back to my app:
protected '_rawResponse' => string '{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"start":"0",
"q":"beethoven eroica",
"sfield":"lat_lon",
"pt":"45.3306,-122.5290",
"bf":"recip(geodist(),1,1000,1000)",
"json.nl":"map",
"wt":"json",
"rows":"10",
"version":"1.4"
}
},
"response":{
"numFound":7,
"start":0,
"docs":[{
"id":"2",
"title":"Symphony No 3, Eroica",
"composer":"Beethoven, Ludwig van",
"publisher":"Schott Musik International",
"location":"Seattle, WA",
"lat_lon":"47.6115,-122.3343"
},{
"id":"28",
"title":"Symphony No 3, Eroica",
"composer":"Beethoven, Ludwig'... (length=1418)
That second doc (with id=28) has lat/lon that match the “pt” value in the query.
What am I doing wrong?
I added
defType=dismaxand now the results are sorted as expected.