[Xapian-discuss] Making Title Fields Have More Weight In Xapian Search

Richard Boulton richard at lemurconsulting.com
Thu Jul 26 11:45:17 BST 2007


James Aylett wrote:
> 100 is pretty dramatic, but you might want to achieve that (say you
> have a field which normally contains nothing, but is very, very
> important when it contains something). weight is a double, so anything
> that will fit in that (which is quite a big range :-) is fine.

Actually, I believe that values supplied to "weight" in scriptindex 
files are integers - the value is used as a multiplier for the wdf - so 
if the weight is 5, a term with 2 occurrences in a document will be 
stored with a wdf of 10.  As long as the resulting value doesn't 
overflow int, there won't be any weird effects, but I don't think we 
check for overflow.  You could probably use up to 10,000 without any 
fear of problems, even for large documents, but whether that would 
actually be useful is debatable.

-- 
Richard



More information about the Xapian-discuss mailing list