strusPython  0.14
Public Member Functions | List of all members
strus::Document Class Reference

Document object representing one item of retrieval. A document can be manually composed of its sub parts or it can be the result of an analyzer run. More...

#include <bindingObjects.hpp>

Public Member Functions

 Document ()
 Default constructor. More...
 
 Document (const Document &o)
 Copy constructor. More...
 
void addSearchIndexTerm (const String &type, const String &value, const Index &position)
 Add a single term occurrence to the document for retrieval. More...
 
void addForwardIndexTerm (const String &type, const String &value, const Index &position)
 Add a single term occurrence to the document for use in the summary of a retrieval result. More...
 
void setMetaData (const String &name, const Variant &value)
 Define a meta data value of the document. More...
 
void setMetaData (const String &name, double value)
 Define a meta data value of the document. More...
 
void setMetaData (const String &name, int value)
 Define a meta data value of the document. More...
 
void setMetaData (const String &name, unsigned int value)
 Define a meta data value of the document. More...
 
void setAttribute (const String &name, const String &value)
 Define an attribute of the document. More...
 
void setUserAccessRight (const String &username)
 Allow a user to access the document. More...
 
void setDocid (const String &docid_)
 Set the document identifier (docid) of the document. More...
 
const TermVector & searchIndexTerms () const
 Get the list of search terms of the document. More...
 
const TermVector & forwardIndexTerms () const
 Get the list of forward terms of the document. More...
 
const MetaDataVector & metaData () const
 Get the list of meta data of the document. More...
 
const AttributeVector & attributes () const
 Get the list of attributes of the document. More...
 
const StringVector & users () const
 Get the list of users that are allowed to access the document. More...
 
const String & docid () const
 Get the document identifier (docid) of the document. More...
 

Detailed Description

Document object representing one item of retrieval. A document can be manually composed of its sub parts or it can be the result of an analyzer run.

Constructor & Destructor Documentation

strus::Document::Document ( )
inline

Default constructor.

strus::Document::Document ( const Document o)

Copy constructor.

Member Function Documentation

void strus::Document::addForwardIndexTerm ( const String &  type,
const String &  value,
const Index position 
)

Add a single term occurrence to the document for use in the summary of a retrieval result.

Parameters
[in]typeterm type name of the forward index term
[in]valueterm value of the forward index term
[in]positionword count position of the forward index term
void strus::Document::addSearchIndexTerm ( const String &  type,
const String &  value,
const Index position 
)

Add a single term occurrence to the document for retrieval.

Parameters
[in]typeterm type name of the search index term
[in]valueterm value of the search index term
[in]positionword count position of the search index term
const AttributeVector& strus::Document::attributes ( ) const
inline

Get the list of attributes of the document.

Returns
the list of attributes
const String& strus::Document::docid ( ) const
inline

Get the document identifier (docid) of the document.

Returns
the document identifier
const TermVector& strus::Document::forwardIndexTerms ( ) const
inline

Get the list of forward terms of the document.

Returns
the list of terms
const MetaDataVector& strus::Document::metaData ( ) const
inline

Get the list of meta data of the document.

Returns
the list of meta data definitions
const TermVector& strus::Document::searchIndexTerms ( ) const
inline

Get the list of search terms of the document.

Returns
the list of terms
void strus::Document::setAttribute ( const String &  name,
const String &  value 
)

Define an attribute of the document.

Parameters
[in]namename of the document attribute
[in]valuevalue of the document attribute
void strus::Document::setDocid ( const String &  docid_)

Set the document identifier (docid) of the document.

Parameters
[in]docid_document identifier of this document
void strus::Document::setMetaData ( const String &  name,
const Variant value 
)

Define a meta data value of the document.

Parameters
[in]namename of the meta data table element
[in]valuevalue of the meta data table element
void strus::Document::setMetaData ( const String &  name,
double  value 
)

Define a meta data value of the document.

Parameters
[in]namename of the meta data table element
[in]valuevalue of the meta data table element
void strus::Document::setMetaData ( const String &  name,
int  value 
)

Define a meta data value of the document.

Parameters
[in]namename of the meta data table element
[in]valuevalue of the meta data table element
void strus::Document::setMetaData ( const String &  name,
unsigned int  value 
)

Define a meta data value of the document.

Parameters
[in]namename of the meta data table element
[in]valuevalue of the meta data table element
void strus::Document::setUserAccessRight ( const String &  username)

Allow a user to access the document.

Parameters
[in]usernamename of the user to be allowed to access this document
Remarks
This function is only implemented if ACL is enabled in the storage
const StringVector& strus::Document::users ( ) const
inline

Get the list of users that are allowed to access the document.

Returns
the list of users allowed to access this document

The documentation for this class was generated from the following file: