MoreLikeThis de Solr: ¿cómo usar un número flotante en mlt.fl?

I really would like to use a float field to find a document's MoreLikeThis documents. However, from what i know i can only use string fields for mlt.fl? What I meant is to use a unique id of a document to find its MoreLikeThis result where mlt.fl field is expected to be a floating point number. Is there a way to do this? Thanks a lot!

preguntado el 03 de julio de 12 a las 06:07

Did you find a way to do this? If so, please can you share. -

1 Respuestas

If you want to prefer myfield field to be close to 10 (for example), boost according to:

&bf="dist(1, myfield, 0, 10, 0)^2"

Desde http://wiki.apache.org/solr/FunctionQuery#Using_FunctionQuery


Actualizar: Seems like MoreLikeThisHandler doesnt support boost functions as you would have wanted. Try extracting the interesting terms with boosts from the MLT handler and then use them on a regular search handler like Dismax.

Respondido 04 Jul 12, 11:07

I just tried this, but it's actually not working...What I meant is to use a unique id of a document to find its MoreLikeThis result where mlt.fl field is expected to be a floating point number. Let me update my question in the post as well. - billones

After researching a whole afternoon, I think the MoreLikeThis handler doesn't support bf param... - billones

Try my new suggestion and see how it performs. Also I used Manhattan distance as I guess it uses only adddtion as opposed to squares and roots for Euclidian. You can also find some function that is maximum at x and tapers off the farther you get from x, dont know how slow that would get. - Jesvin José

Still doesn't seem to work...SimilarPriceRating is a string i converted from int. Say rating is 1, then SimilarPriceRating is "0 1 2" <str name="mlt.qf"> Title^0.5 Manu^5.0 cat^10.0 </str> <str name="mlt.fl">Title,Manu,cat</str> <int name="mlt.count">12</int> <int name="mlt.mintf">1</int> <int name="mlt.mindf">1</int> <str name="mlt.interestingTerms">SimilarPriceRating</str> <bool name="mlt.boost">true</bool> - billones

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.