[Xapian-discuss] I can't get prefixes to work

Jim jim at fayettedigital.com
Wed Oct 31 00:35:11 GMT 2007


Xapian, omega and scriptindex version 1.0.3 from HEAD about a week ago.


This is from omega FMT=godmode. 
1 XRULERule_237 
<http://picolex.com/cgi-bin/firelex/omega.cgi?DB=trial%2fsec&FMT=godmode&B=XRULERule%5f237>

This is the code.
    my $query = "rule:Rule_237";
    my $qp = new Search::Xapian::QueryParser();
    $qp->set_stemmer(new Search::Xapian::Stem("english"));
    $qp->set_stemming_strategy(STEM_SOME);
    $qp->set_default_op($defaultop);
    $qp->add_boolean_prefix('rule','XRULE');
    my $par = $qp->parse_query($query);
    my $enq = $db->enquire( $par );
    print LOG "Running query ". $enq->get_query()->get_description()."\n";;


I return no hits and the log reads:

Running query Xapian::Query(XRULE:Rule_237)

If I run a normal query for a word, it works as expected.  This holds 
true for lots of examples of rule:, not just this one.

I then used add_prefix and got closer:

Running query Xapian::Query(XRULErule_237:(pos=1))

So I tried
    my $query = "rule:rule_237";

Running query Xapian::Query(ZXRULErule_237:(pos=1))

It was indexed with:

rule : field boolean=XRULE

So what did I do wrong?

Thanks,
Jim.





More information about the Xapian-discuss mailing list