Kevin SoftDev
2006-Mar-07 16:57 UTC
[Xapian-discuss] Total matches found and how to disable stemming.
Hello, 1.) Please can somebody let me know what is the best way to find total matches on terms? Perl example: my $db = Search::Xapian::Database->new( '/europa2' ); my $qp = Search::Xapian::QueryParser->new(); my $enq = $db->enquire($qp->parse_query($terms)); #----- now at this point I want only to display matches from 0 - 25 my @matches = $enq->matches(0, 25); # but what is the best wayt to find ahead, how many total matches we have for the terms? 2.) How do I disable stemming. I think Xapian keep stemming terms despite my terms are not in English. Kevin http://nitra.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20060307/93b8035a/attachment-0001.htm
Olly Betts
2006-Mar-09 00:23 UTC
[Xapian-discuss] Total matches found and how to disable stemming.
On Tue, Mar 07, 2006 at 08:57:24AM -0800, Kevin SoftDev wrote:> 1.) Please can somebody let me know what is the best way to find total > matches on terms?MSet::get_matches_estimated() : http://www.xapian.org/docs/apidoc/html/classXapian_1_1MSet.html#eab0a82126d9f2cf0ef5321549ea9775 This is an estimate - you can find out upper and lower bounds on the value with MSet::get_matches_upper_bound() and MSet::get_matches_lower_bound().> 2.) How do I disable stemming. I think Xapian keep stemming terms despite my > terms are not in English.I assume you mean at search time when using the QueryParser, in which case you want to call QueryParser::set_stemming_strategy() with QueryParser::STEM_NONE. Cheers, Olly
Kevin SoftDev
2006-Mar-09 17:06 UTC
[Xapian-discuss] Total matches found and how to disable stemming.
Olly, Yes I tried but I am nit sure if I understand the right syntax in Perl. Is this one correct ? Because does not seems to work. my $qp = Search::Xapian::QueryParser->new(); $qp->set_stemming_strategy(STEM_NONE); my $enq = $db->enquire($qp->parse_query($terms)); Kevin On 3/8/06, Olly Betts <olly@survex.com> wrote:> > On Tue, Mar 07, 2006 at 08:57:24AM -0800, Kevin SoftDev wrote: > > 1.) Please can somebody let me know what is the best way to find total > > matches on terms? > > MSet::get_matches_estimated() : > > > http://www.xapian.org/docs/apidoc/html/classXapian_1_1MSet.html#eab0a82126d9f2cf0ef5321549ea9775 > > This is an estimate - you can find out upper and lower bounds on the > value with MSet::get_matches_upper_bound() and > MSet::get_matches_lower_bound(). > > > 2.) How do I disable stemming. I think Xapian keep stemming terms > despite my > > terms are not in English. > > I assume you mean at search time when using the QueryParser, in which > case you want to call QueryParser::set_stemming_strategy() with > QueryParser::STEM_NONE. > > Cheers, > Olly >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20060309/16415506/attachment.htm