[Xapian-discuss] Queryparser problem..

Olly Betts olly at survex.com
Sun Dec 9 18:28:47 GMT 2007


On Sun, Dec 09, 2007 at 07:06:36PM +0100, Jesper Krogh wrote:
> I'm probably just (mis-)using Xapian anyway. The problem is that every 
> document should be traceable after retrieval. Thus I add:
> doctype:<type> and id:<id>
> The "viewer" application, then knows what to do and I can search the 
> document up and replace it by letting the indexer query for "doctype:<> 
> id:<>" before doing add_ or replace_.
> 
> This worked flawless until my "doctype" actually was stemmable..
> 
> How does people generally solve this task? (adding a 0 in fron of my 
> doctype would solve the problem.. but elegant?).

Just add such terms unstemmed using Document::add_term(), and then tell
the QueryParser that such prefixes are boolean filters using
QueryParser::add_boolean_prefix().

Cheers,
    Olly



More information about the Xapian-discuss mailing list