[Xapian-discuss] Omega and Wildcards

Kenneth Loafman kenneth at loafman.com
Tue Oct 2 21:34:07 BST 2007


I made the following changes to Omega, per the instructions in

http://www.xapian.org/docs/queryparser.html,

and wildcards do not work at all.  I'm hoping its something simple.

/usr/lib/cgi-bin/omega/omega DB=pdf P=finan\*
(with or without the backslash)

returns no documents, even though there are over 3000 hits for
'finance', about the same for 'financial', and probably more.

...Ken


ken at phobos:~/xapian/xapian-omega-1.0.2$ diff -aur query.cc*
--- query.cc    2007-10-02 14:33:35.000000000 -0500
+++ query.cc~   2007-07-04 19:38:41.000000000 -0500
@@ -218,6 +218,7 @@
     qp.set_stemming_strategy(option["stem_all"] == "true" ?
Xapian::QueryParser::STEM_ALL : Xapian::QueryParser::STEM_SOME);
     qp.set_stopper(new MyStopper());
     qp.set_default_op(default_op);
+    qp.set_database(db);
     // std::map::insert() won't overwrite an existing entry, so we'll
prefer
     // probabilistic prefixes to boolean ones in the unlikely event
that both
     // exist for the same term prefix.  We'll also prefer the first
specified
@@ -236,17 +237,12 @@
     }

     try {
-       query = qp.parse_query(query_string,
-                               Xapian::QueryParser::FLAG_BOOLEAN |
-                               Xapian::QueryParser::FLAG_PHRASE |
-                               Xapian::QueryParser::FLAG_LOVEHATE |
-                               Xapian::QueryParser::FLAG_WILDCARD);
+       query = qp.parse_query(query_string);
     } catch (Xapian::QueryParserError &e) {
        error_msg = e.get_msg();
        return BAD_QUERY;
     }

-    qp.set_database(db);
     Xapian::termcount n_new_terms = 0;
     for (Xapian::TermIterator i = query.get_terms_begin();
         i != query.get_terms_end(); ++i) {



More information about the Xapian-discuss mailing list