[Xapian-discuss] How to make QueryParser select entire word like "H.O.T"

David testwe at 126.com
Tue Nov 2 10:41:24 GMT 2010


Hi,
 
I'm using xapian to build my search engine, but met with a problem.
The code snippet is like:
----------------------Code begin-------------------------------------------------------------
Xapian::QueryParser qp;
qp.add_prefix("Singer", "S");
Xapian::Query query = qp.parse_query("Singer:s.h.e", Xapian::QueryParser::FLAG_PARTIAL|Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS |Xapian::QueryParser::FLAG_PHRASE );
cout << "Performing query `" << query.get_description() << "'" << endl;
----------------------Code end---------------------------------------------------------------
 
See the output from the stdio,
----------------------Output begin---------------------------------------------------------
Performing query `Xapian::Query((Ss:(pos=1) PHRASE 3 Sh:(pos=2) PHRASE 3 Se:(pos=3)))'
----------------------Output end-----------------------------------------------------------
 
See the problem? Actually "s.h.e" is a music band from Taiwan, and I want to use this as an entire query word to search in the singer field.
So any one who know how to let the parser get "Ss.h.e" rather than splitted query ?
 
 
 
Thanks :)


More information about the Xapian-discuss mailing list