[Xapian-discuss] Using special characters in query terms

Lars Kruse lists at sumpfralle.de
Wed Apr 2 04:56:57 BST 2008


Hi,

I would like to search for filenames in a xapian database.

For now my query for "foo-bar.po" turns into the following:
  Xapian::Query((foo:(pos=1) PHRASE 3 bar:(pos=2) PHRASE 3 po:(pos=3)))

This query is successful, if I used the term generator to tokenize "foo-bar.po"
during indexing.

The problem is: this workaround makes it impossible to distinguish between
"foo-bar.po" and "foo/bar.po".

A similar problem was described here:
http://grokbase.com/topic/2006/08/07/xapian-discuss-search-with-symbols-causes-search-time-to-hemorrhage/oO3ndMNfB_B9PY-NntCHJT9STto
But I couldn't follow the link to the bug database
(http://www.xapian.org/cgi-bin/bugzilla/show_bug.cgi?id=22), since bugzilla
seems to be unavailable at the moment.


My question: is there any way to protect special characters in a query?


thanks for your time,
Lars



More information about the Xapian-discuss mailing list