[Xapian-discuss] normal prefix vs. boolean prefix

Torsten Foertsch torsten.foertsch at gmx.net
Fri Nov 7 16:50:43 GMT 2008


Hi,

just to clarify, what is the difference between a normal prefix and a 
boolean prefix?

If I understand it correctly a normal prefix is a way to give a name to 
a certain part of the index. When the ranking is computed the values 
influence the ranking of a resulting entity according to their weight.

A boolean prefix also names a certain part of the index but its purpose 
is to filter the result set literally without influence on the ranking.

Assuming:

  $qp->add_prefix(normal=>'S');
  $qp->add_boolean_prefix(bool=>'S');

the 2 queries "normal:something AND something else" and "bool:something 
AND something else" will give the same result set but possibly with 
different ranking. But even the ranking would be the same if the weight 
of the "normal:something" part of the first query is set to 0.

Is that true?

Another question, is it possible to do something like the following in 
Perl?

Xapian::Query q(OP_AND, Xapian::Query(OP_SCALE_WEIGHT, q_title, FACTOR), 
q_body);

Just a guess:

Search::Xapian::Query->new(OP_AND,
                           Search::Xapian::Query->new(OP_SCALE_WEIGHT, 
                                                      $q_title, 2.5),
                           $q_body)

Thanks,
Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch at gmx.net



More information about the Xapian-discuss mailing list