[Xapian-discuss] Index-time weight of a document and weight per document field

Thomas Viehmann tv at beamnet.de
Wed Feb 25 19:37:09 GMT 2009


Hi Maciej,

Maciej Zięba wrote:
> I guess this can't be done with any existing tool (for example with 
> scriptindex) and I would have to write my own indexer (I will try to use 
> Python bindings).  Am I right?

Internally, Xapian assigns weights to terms attached to a document.
In the Xapian API, a TermGenerator's index text takes an optional weight
parameter and (at a lower level) the Document's add_term or add_posting
method take an (optional) argument wdfinc to specify weight increase.

For scriptindex, the weight parameter is specified as part of the field
definitions in the .script (see the examples). For a quick test, you
could likely (too cumbersome unless you have a very limited number of
classes of documents) use different .script files for varying the weights.

Kind regards

T.
-- 
Thomas Viehmann, http://thomas.viehmann.net/



More information about the Xapian-discuss mailing list