質問

I am trying to create a recommender using SOLR, matching on a text field called title. I want it to return matches based on the (document similarity on title field)/(geospatial distance from a point). So the recommendations should take into account both textual similarity and geospatial distance from the document I am matching against, favoring documents that are both similar and close by geographically. I tried doing this using the mlt.fl and mlt.qf handler:

http://localhost/solr/core1/select?q=id%3A+2801301&rows=10&wt=json&indent=true&mlt=true&mlt.fl=title,dst:recip(geodist(location,40.7573,-73.5775))&qf=title,dist&mlt.mintf=1&mlt.mindf=5&mlt.interestingTerms=details

However this does not work, distance appears to be completely ignored. Is there a way to achieve this? Or do I need to write a query instead to generate recommended documents?

役に立ちましたか?

解決

After a lot of searching and trying different things, I came across this. Looks like it does what I need, and at the very least shows how to implement a custom MLT handler:

https://github.com/dfdeshom/custom-mlt

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top