It's usually a mistake to try to tune at this level. The tf/idf calculations _already_ take into account the field length (measured in tokens) when scoring. Matches on shorter fields add more to the score than matches on longer fields, which seems to be what you're looking for.
That said, the length of the field is encoded and loses some precision in order to save space (although I believe if memory serves you can use higher precision lately). So Solr/Lucene will tend to think most fields with, say, less n tokens are all the same length.... Very often, people spend lots of time chasing this down in artificial test cases only to discover that when looking at real data, the tweaking is unnecessary. So I'm not really giving you any guidance to do what you asked, rather I'm suggesting that you don't even try :).. Best, Erick On Tue, Jan 14, 2014 at 12:11 PM, Sébastien LAMAISON <y...@hotmail.fr> wrote: > Hi all, > I'm almost new to SolR, and I have to make a improvment on a existing > project, but despite some hours of searching, I'm stuck. > We have an index containing products, which the user can search by reference, > or name.By now, when the user make a search by product name, the score is the > same for all products containing the search string in the name. > For example, if the search string is "TEST", the following products have the > same score : - BLAHBLAH TEST BLAH- TEST BLAHBLAH- BLAHBLAHBLAHBLAHBLAHBLAH > TEST > My question is : how can I make TEST BLAHBLAH have a better score than > BLAHBLAH TEST BLAH have a better score than BLAHBLAHBLAHBLAHBLAHBLAH TEST if > the user search "TEST" ? > Thanks in advance. > Seb