Shen Li
2011-Dec-14 23:16 UTC
[Xapian-devel] How to enable stemming with default_op set to OP_NEAR
Hi All, I know that from version 1.2.6, if default_op is OP_NEAR or OP_PHRASE then stemming of the terms is disabled, since positional information isn't indexed for stemmed terms by default. However, I would like to try using OP_NEAR as default_op with stemming because I think the near operator is somehow different from exact phrase. Then I wanna see how the search results looks with this setting compared to those with OP_AND as default_op. However, even I managed to index stemmed terms with position information I couldn't find where to make changes to enable stemming in queryparser. I checked with queryparser.cc and queryparser_internal.cc, but haven't find the exact piece of codes which disabled stemming when default_op is OP_NEAR. So I guess maybe someone here could offer some help, and I really appreciate your time! Thanks, Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20111215/17789744/attachment.html>
Olly Betts
2011-Dec-15 01:02 UTC
[Xapian-devel] How to enable stemming with default_op set to OP_NEAR
On Thu, Dec 15, 2011 at 07:16:14AM +0800, Shen Li wrote:> I couldn't find where to make changes to enable stemming in > queryparser. I checked with queryparser.cc and > queryparser_internal.cc, but haven't find the exact piece of codes > which disabled stemming when default_op is OP_NEAR. So I guess maybe > someone here could offer some help, and I really appreciate your time!Look for add_positional_term() in queryparser/queryparser.lemony. You'll need to configure with --enable-maintainer-mode so that lemon gets run to regenerate the parser code. Cheers, Olly