This project has retired. For details please refer to its Attic page.
Lucy::Document::HitDoc – C API Documentation
Apache Lucy™

Lucy::Document::HitDoc

parcel Lucy
class variable LUCY_HITDOC
struct symbol lucy_HitDoc
class nickname lucy_HitDoc
header file Lucy/Document/HitDoc.h

Name

Lucy::Document::HitDoc – A document read from an index.

Description

HitDoc is the search-time relative of the index-time class Doc; it is augmented by a numeric score attribute that Doc doesn’t have.

Methods

Set_Score
void
lucy_HitDoc_Set_Score(
    lucy_HitDoc *self,
    float score
);

Set score attribute.

Get_Score
float
lucy_HitDoc_Get_Score(
    lucy_HitDoc *self
);

Get score attribute.

Equals
bool
lucy_HitDoc_Equals(
    lucy_HitDoc *self,
    cfish_Obj *other
);

Indicate whether two objects are the same. By default, compares the memory address.

other

Another Obj.

Methods inherited from Lucy::Document::Doc

Set_Doc_ID
void
lucy_HitDoc_Set_Doc_ID(
    lucy_HitDoc *self,
    int32_t doc_id
);

Set internal Lucy document id.

Get_Doc_ID
int32_t
lucy_HitDoc_Get_Doc_ID(
    lucy_HitDoc *self
);

Retrieve internal Lucy document id.

Store
void
lucy_HitDoc_Store(
    lucy_HitDoc *self,
    cfish_String *field,
    cfish_Obj *value
);

Store a field value in the Doc.

field

The field name

value

The value

Get_Fields
void*
lucy_HitDoc_Get_Fields(
    lucy_HitDoc *self
);

Return the Doc’s backing fields hash.

Get_Size
uint32_t
lucy_HitDoc_Get_Size(
    lucy_HitDoc *self
);

Return the number of fields in the Doc.

Extract
cfish_Obj* // incremented
lucy_HitDoc_Extract(
    lucy_HitDoc *self,
    cfish_String *field
);

Retrieve the field’s value, or NULL if the field is not present.

Field_Names
cfish_Vector* // incremented
lucy_HitDoc_Field_Names(
    lucy_HitDoc *self
);

Return a list of names of all fields present.

Inheritance

Lucy::Document::HitDoc is a Lucy::Document::Doc is a Clownfish::Obj.