I'm trying to index the word "peter-bengtsson" (which is different from "peter" & "bengtsson" and is different from "peterbengtsson") and find it. To start with I'm trying to use a basic python script to get to grips with it. When I do this:: qp = xapian.QueryParser() stemmer = xapian.Stem("english") qp.set_stemmer(stemmer) qp.set_database(database) qp.set_stemming_strategy(xapian.QueryParser.STEM_SOME) print "Query string is:", repr(query_string) query = qp.parse_query(query_string) print "Parsed query is: %s" % str(query) I get the following output:: Query string is: 'peter-bengtsson' Parsed query is: Xapian::Query((ssh:(pos=1) PHRASE 2 bengtsson:(pos=2))) 22 results found. This is wrong as I know I only have one document with the word "peter-bengtsson" in it. How do I make the search for exactly "peter-bengtsson" or exacly "ssh-add" or "e-mail"? -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com fun crosstips.org
On Wed, Mar 31, 2010 at 03:00:00PM +0100, Peter Bengtsson wrote:> How do I make the search for exactly "peter-bengtsson" or exacly > "ssh-add" or "e-mail"?query = xapian.Query("peter-bengtsson") (You can't currently achieve with using QueryParser). Cheers, Olly