[Xapian-discuss] Query Parser, filenames and compound words

Olly Betts olly at survex.com
Fri Dec 30 03:52:00 GMT 2005


On Fri, Dec 30, 2005 at 12:43:22AM +0000, Ted Jordan wrote:
> When I submit a filename to the query parser it breaks it up 
> 
> Example: 
> 
> /home/user/file_name.ext
> 
> becomes
> 
> Xapian::Query((home:(pos=1) PHRASE 5 user:(pos=2) PHRASE 5 file:(pos=3) PHRASE 
> 5 name:(pos=4) PHRASE 5 ext:(pos=5)))
> 
> which does not find the document.

The QueryParser currently expects you to have tokenised text in a
similar way to how Omega's indexers do (this is because historically
the QueryParser was part of Omega, and was then split off into a more
generic class).

Ultimately there should be some way to tell the QueryParser how you
tokenised (or it should be able to work it out by being able to test
terms in the database).  Currently you can say if and how stemming was
done but not much else.  Hopefully I'll be able to address this in
the release after the one I'm currently trying to get out the door.

But currently I'm afraid you either need to index like Omega does (look
at indextext.cc in the omega sources for the full details), or parse
query strings yourself.

Cheers,
    Olly



More information about the Xapian-discuss mailing list