parcel | Lucy |
class variable | LUCY_DOC |
struct symbol | lucy_Doc |
class nickname | lucy_Doc |
header file | Lucy/Document/Doc.h |
Lucy::Document::Doc – A document.
A Doc object is akin to a row in a database, in that it is made up of one or more fields, each of which has a value.
lucy_Doc* // incremented
lucy_Doc_new(
void *fields,
int32_t doc_id
);
Create a new Document.
Field-value pairs.
Internal Lucy document id. Default of 0 (an invalid doc id).
lucy_Doc*
lucy_Doc_init(
lucy_Doc *self,
void *fields,
int32_t doc_id
);
Initialize a Document.
Field-value pairs.
Internal Lucy document id. Default of 0 (an invalid doc id).
void
lucy_Doc_Set_Doc_ID(
lucy_Doc *self,
int32_t doc_id
);
Set internal Lucy document id.
int32_t
lucy_Doc_Get_Doc_ID(
lucy_Doc *self
);
Retrieve internal Lucy document id.
void
lucy_Doc_Store(
lucy_Doc *self,
cfish_String *field,
cfish_Obj *value
);
Store a field value in the Doc.
The field name
The value
void*
lucy_Doc_Get_Fields(
lucy_Doc *self
);
Return the Doc’s backing fields hash.
uint32_t
lucy_Doc_Get_Size(
lucy_Doc *self
);
Return the number of fields in the Doc.
cfish_Obj* // incremented
lucy_Doc_Extract(
lucy_Doc *self,
cfish_String *field
);
Retrieve the field’s value, or NULL if the field is not present.
cfish_Vector* // incremented
lucy_Doc_Field_Names(
lucy_Doc *self
);
Return a list of names of all fields present.
bool
lucy_Doc_Equals(
lucy_Doc *self,
cfish_Obj *other
);
Indicate whether two objects are the same. By default, compares the memory address.
Another Obj.
Lucy::Document::Doc 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.