lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Á_____o <>
Subject Re: Combining Solr score with customized user ratings for a document
Date Fri, 22 Feb 2013 09:44:19 GMT
Chris Hostetter-3 wrote
> Perhaps what you are refering to is the idea that if you wnat the "score" 
> to remain purely about relevancy, you can still opionally sort on the 
> results of this function, by using the function solely in your sort -- the 
> only thing that tends to confuse people here is how you refer back to the 
> original query in that "sort by function" command...
> or in your case, something like this would return the both the raw 
> score, and your custom rating, but it would sort on the product of those 
> two values...
> ?q=text:grapa&fl=id,score,rating(usuario1)&sort=product(rating(usuario1),query($q)

I didn't understand you in your previous post but now it's completely clear.
I don't really need the relevancy, so my query is fine. :)

Chris Hostetter-3 wrote
> : Which is the best place to do it? I think I would query the DB/cache
> just
> : when the custom ValueSource is created in the ValueSourceParser's parse
> That might makes sense, but becareful where you put this cache data -- 
> if it's part of the ValueSource then whenever that ValueSource is used in 
> a FunctionQuery (ie: "{!boost b=rating(usuario1)}text:grapa" it will be 
> part of the cache key for the queryResultCache or filterCache -- so having 
> large data structures in your ValueSource could eat up a lot of RAM.  Take 
> a look at src/docs/differences between the ValueSource class and the 
> FunctionValues class

OK that's something I'll have to check... I might reduce the size of the
rating map just to the most significant values to save some memory, or
remove completely the cache because, as I said, the ratings are extracted
from a properly indexed MySQL DB's table in the same Server as Solr is so -i
think (and hope) - the access to them shouldn't be too slow.

Well, definitely you have helped me a lot and I can now move to other issues
of the proyect ;)
THANKS both Hoss and Tim!!!


View this message in context:
Sent from the Solr - User mailing list archive at

View raw message