strus  0.17
Public Member Functions | List of all members
strus::StorageTransactionInterface Class Referenceabstract

Object to declare all items for one insert/update of a document in the storage. More...

#include <storageTransactionInterface.hpp>

Public Member Functions

virtual ~StorageTransactionInterface ()
 Destructor. More...
 
virtual StorageDocumentInterfacecreateDocument (const std::string &docid_)=0
 Create one document to be inserted/replaced within this transaction. More...
 
virtual
StorageDocumentUpdateInterface
createDocumentUpdate (const Index &docno_)=0
 Create an interface for a document to be updated within this transaction. More...
 
virtual void deleteDocument (const std::string &docid)=0
 Declare a document to be removed from the storage within this transaction. More...
 
virtual void deleteUserAccessRights (const std::string &username)=0
 Declare the access rights of a user to any document to be removed from the storage within this transaction. More...
 
virtual void updateMetaData (const Index &docno, const std::string &varname, const NumericVariant &value)=0
 Update of meta data for a specific document (without creating it) More...
 
virtual void updateDocumentFrequency (const std::string &type, const std::string &value, int df_change)=0
 Update of document frequency for features not in search index that get an implicitely stored df assigned. More...
 
virtual bool commit ()=0
 Insert all documents and executes all commands defined in the transaction or none if one operation fails. More...
 
virtual void rollback ()=0
 Rollback of the transaction, no changes made. More...
 
virtual unsigned int nofDocumentsAffected () const =0
 Get the number of documents affected by the last transaction in case of a successful commit. More...
 

Detailed Description

Object to declare all items for one insert/update of a document in the storage.

Constructor & Destructor Documentation

virtual strus::StorageTransactionInterface::~StorageTransactionInterface ( )
inlinevirtual

Destructor.

Remarks
Expected to do an implicit rollback, if neither 'commit()' or 'rollback' was called

Member Function Documentation

virtual bool strus::StorageTransactionInterface::commit ( )
pure virtual

Insert all documents and executes all commands defined in the transaction or none if one operation fails.

Returns
true on success, false on error
virtual StorageDocumentInterface* strus::StorageTransactionInterface::createDocument ( const std::string &  docid_)
pure virtual

Create one document to be inserted/replaced within this transaction.

Parameters
[in]docid_identifier of the document
Returns
the document object
virtual StorageDocumentUpdateInterface* strus::StorageTransactionInterface::createDocumentUpdate ( const Index docno_)
pure virtual

Create an interface for a document to be updated within this transaction.

Parameters
[in]docno_document number of the document (StorageClientInterface::documentNumber( const std::string&))
Returns
the document updater object
virtual void strus::StorageTransactionInterface::deleteDocument ( const std::string &  docid)
pure virtual

Declare a document to be removed from the storage within this transaction.

Parameters
[in]dociddocument identifier (URI)
virtual void strus::StorageTransactionInterface::deleteUserAccessRights ( const std::string &  username)
pure virtual

Declare the access rights of a user to any document to be removed from the storage within this transaction.

Parameters
[in]usernameuser name
virtual unsigned int strus::StorageTransactionInterface::nofDocumentsAffected ( ) const
pure virtual

Get the number of documents affected by the last transaction in case of a successful commit.

Returns
the number of documents (deletes,updates,inserts)
virtual void strus::StorageTransactionInterface::rollback ( )
pure virtual

Rollback of the transaction, no changes made.

virtual void strus::StorageTransactionInterface::updateDocumentFrequency ( const std::string &  type,
const std::string &  value,
int  df_change 
)
pure virtual

Update of document frequency for features not in search index that get an implicitely stored df assigned.

Parameters
[in]typetype of the feature
[in]valuevalue of the feature
[in]df_changedocument frequency increment/decrement for feature type/value
Note
This method is useful if you want to store the document frequency for features in the forward index, that do not get a df value assigned implicitely. For example for weighting of extracted features with their occurrence and idf.
virtual void strus::StorageTransactionInterface::updateMetaData ( const Index docno,
const std::string &  varname,
const NumericVariant &  value 
)
pure virtual

Update of meta data for a specific document (without creating it)

Parameters
[in]docnodocument number
[in]varnamemeta data element name to update
[in]valuenew value of this meta data element

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