parcel | Lucy |
class variable | LUCY_MATCHER |
struct symbol | lucy_Matcher |
class nickname | lucy_Matcher |
header file | Lucy/Search/Matcher.h |
Lucy::Search::Matcher – Match a set of document ids.
A Matcher iterates over a set of ascending document ids. Some Matchers implement Score() and can assign relevance scores to the docs that they match. Other implementations may be match-only.
lucy_Matcher*
lucy_Matcher_init(
lucy_Matcher *self
);
Abstract initializer.
int32_t
lucy_Matcher_Next(
lucy_Matcher *self
);
Proceed to the next doc id.
Returns: A positive doc id, or 0 once the iterator is exhausted.
int32_t
lucy_Matcher_Advance(
lucy_Matcher *self,
int32_t target
);
Advance the iterator to the first doc id greater than or equal to
target
. The default implementation simply calls Next()
over and over, but subclasses have the option of doing something more
efficient.
A positive doc id, which must be greater than the current doc id once the iterator has been initialized.
Returns: A positive doc id, or 0 once the iterator is exhausted.
int32_t
lucy_Matcher_Get_Doc_ID(
lucy_Matcher *self
);
Return the current doc id. Valid only after a successful call to Next() or Advance() and must not be called otherwise.
float
lucy_Matcher_Score(
lucy_Matcher *self
);
Return the score of the current document.
Only Matchers which are used for scored search need implement Score().
Lucy::Search::Matcher is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.