[Xapian-discuss] QueryParser (I think) question

Andreas Marienborg andreas at startsiden.no
Wed May 23 15:33:40 BST 2007


On May 23, 2007, at 10:02 AM, Olly Betts wrote:

> On Wed, May 23, 2007 at 09:26:05AM +0200, Andreas Marienborg wrote:
>> On May 22, 2007, at 10:01 PM, Richard Boulton wrote:
>>> Firstly, I should note that I don't get the same behaviour as you
>>> here (with Xapian 1.0.0, and the standard options for parse_query
>>> ()): I'm guessing from your output that you're using a Xapian 0.9
>>> release. Upgrading might help a bit, but the handling isn't perfect
>>> even in 1.0.0, sadly: query parsers are incredibly hard to get
>>> right for all cases.
>>
>> Yes, but I am unable to find Search::Xapian (perl-modules) for 1.0 on
>> cpan. Is there anywhere else I might obtain them?
>
> I'm working on updating Search::Xapian for 1.0.0, but it's not quite
> ready yet - I still need to finish wrapping the new TermGenerator  
> class.
>
> Here's a snapshot of the current state.  I wouldn't advise using  
> this in
> a production system yet, but it should be fine for testing.
>
> http://oligarchy.co.uk/xapian/patches/Search-Xapian-1.0.0.0.tar.gz
>

thanks, I have now upgraded to 1.0.0 at least :) It was a very smooth  
upgrade

>> Query: (brukervennlighet) AND (source:1 OR source:2)
>> unmodified query: Xapian::Query((brukervennlighet:(pos=1) AND (S1 OR
>> S2)))
>> [...]
>
> I'm not sure it's especially interesting exactly why these examples
> parse as they do.  Essentially, those that "work" do so by  
> coincidence.
>
> The grammar needs sorting out to make this work properly.  We also
> need to decide what something like this should do:
>
>     brukervennlighet OR source:1
>
> The problem with the "obvious" interpretation is how the ranking  
> should
> work.  We could just treat source:1 as a probabilistic term.  Xapian
> doesn't really distinguish at the term level so this would work, but
> does that make sense for a term prefix we were told was a boolean
> filter?
>

I would say such a query is invalid, but that might be because of my  
lack of
understanding.

Where would one start to look if one needed to implement ORing of  
similar boolean terms as a start?

>> When searching I do
>>     my $query_obj=$self->qp->parse_query( $processed_query );
>> so I don't think I am setting any flags.
>
> You're implicitly setting the default flags, which are the same for
> Perl and C++ (though the Perl wrappers currently hardcode them as `7'
> which is just asking for problems in the future, as well as being an
> obscure magic value).
>

Aha, ok :) thats good to know.


Thanks again,

- andreas






More information about the Xapian-discuss mailing list