parcel | Lucy |
class variable | LUCY_SIMPLE |
struct symbol | lucy_Simple |
class nickname | lucy_Simple |
header file | Lucy/Simple.h |
Lucy::Simple – Basic search engine.
Lucy::Simple is a stripped-down interface for the Apache Lucy search engine library.
lucy_Simple*
lucy_Simple_new(
cfish_Obj *path,
cfish_String *language
);
Create a Lucy::Simple object, which can be used for both indexing and
searching. Both parameters path
and language
are required.
Where the index directory should be located. If no index is found at the specified location, one will be created.
The language of the documents in your collection, indicated by a two-letter ISO code. 12 languages are supported:
|-----------------------|
| Language | ISO code |
|-----------------------|
| Danish | da |
| Dutch | nl |
| English | en |
| Finnish | fi |
| French | fr |
| German | de |
| Italian | it |
| Norwegian | no |
| Portuguese | pt |
| Spanish | es |
| Swedish | sv |
| Russian | ru |
|-----------------------|
lucy_Simple*
lucy_Simple_init(
lucy_Simple *self,
cfish_Obj *path,
cfish_String *language
);
Initialize a Lucy::Simple object.
void
lucy_Simple_Add_Doc(
lucy_Simple *self,
lucy_Doc *doc
);
Add a document to the index.
uint32_t
lucy_Simple_Search(
lucy_Simple *self,
cfish_String *query,
uint32_t offset,
uint32_t num_wanted,
lucy_SortSpec *sort_spec
);
Search the index. Returns the total number of documents which match
the query. (This number is unlikely to match num_wanted
.)
A search 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.
lucy_HitDoc* // incremented
lucy_Simple_Next(
lucy_Simple *self
);
Return the next hit, or NULL when the iterator is exhausted.
Lucy::Simple 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.