parcel | Lucy |
class variable | LUCY_SEARCHER |
struct symbol | lucy_Searcher |
class nickname | lucy_Searcher |
header file | Lucy/Search/Searcher.h |
Lucy::Search::Searcher – Base class for searching collections of documents.
Abstract base class for objects which search. Core subclasses include IndexSearcher and PolySearcher.
lucy_Searcher*
lucy_Searcher_init(
lucy_Searcher *self,
lucy_Schema *schema
);
Abstract initializer.
A Schema.
int32_t
lucy_Searcher_Doc_Max(
lucy_Searcher *self
);
Return the maximum number of docs in the collection represented by the Searcher, which is also the highest possible internal doc id. Documents which have been marked as deleted but not yet purged are included in this count.
uint32_t
lucy_Searcher_Doc_Freq(
lucy_Searcher *self,
cfish_String *field,
cfish_Obj *term
);
Return the number of documents which contain the term in the given field.
Field name.
The term to look up.
lucy_Query* // incremented
lucy_Searcher_Glean_Query(
lucy_Searcher *self,
cfish_Obj *query
);
If the supplied object is a Query, return it; if it’s a query string, create a QueryParser and parse it to produce a query against all indexed fields.
lucy_Hits* // incremented
lucy_Searcher_Hits(
lucy_Searcher *self,
cfish_Obj *query,
uint32_t offset,
uint32_t num_wanted,
lucy_SortSpec *sort_spec
);
Return a Hits object containing the top results.
Either a Query object or a query string.
The number of most-relevant hits to discard, typically
used when “paging” through hits N at a time. Setting
offset
to 20 and num_wanted
to 10 retrieves
hits 21-30, assuming that 30 hits can be found.
The number of hits you would like to see after
offset
is taken into account.
A SortSpec, which will affect how results are ranked and returned.
void
lucy_Searcher_Collect(
lucy_Searcher *self,
lucy_Query *query,
lucy_Collector *collector
);
Iterate over hits, feeding them into a Collector.
A Query.
A Collector.
lucy_HitDoc* // incremented
lucy_Searcher_Fetch_Doc(
lucy_Searcher *self,
int32_t doc_id
);
Retrieve a document. Throws an error if the doc id is out of range.
A document id.
lucy_Schema*
lucy_Searcher_Get_Schema(
lucy_Searcher *self
);
Accessor for the object’s schema
member.
Lucy::Search::Searcher 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.