Public Member Functions | Data Fields

Sphinx::AttributeUpdates_t Struct Reference

structure that holds attribute names and their values in documents to be updated More...

#include <sphinxclient.h>

Public Member Functions

 AttributeUpdates_t ()
 constructor, default command version is VER_COMMAND_UPDATE_0_9_8
void setAttributeList (const std::vector< std::string > &attr=std::vector< std::string >())
 sets attribute list, clears value list
void addAttribute (const std::string &)
 adds attribute to attribute list, clears value list
void addDocument (uint64_t id, const std::vector< Value_t > &vals)
 Add document to update attributes at and their values in vector.
void addDocument (uint64_t id, ValueType_t t,...)
 Add a document to update attributes at and their values if type t in variable-length argument list. Doesn't check the argument count.
void setCommandVersion (UpdateCommandVersion_t v)
 set update command version

Data Fields

UpdateCommandVersion_t commandVersion
std::vector< std::string > attributes
std::map< uint64_t,
std::vector< Value_t > > 
values

Detailed Description

structure that holds attribute names and their values in documents to be updated


Member Function Documentation

void Sphinx::AttributeUpdates_t::addDocument ( uint64_t  id,
ValueType_t  t,
  ... 
)

Add a document to update attributes at and their values if type t in variable-length argument list. Doesn't check the argument count.

Parameters:
id document id
t type of following arguments (uint32_t and float supported)
... argument values of previously defined type
void Sphinx::AttributeUpdates_t::addDocument ( uint64_t  id,
const std::vector< Value_t > &  vals 
)

Add document to update attributes at and their values in vector.

Parameters:
id document id
vals vector of attribute values, size must match attribute count
Exceptions:
ClientUsageError_t when attribute count doesn't match value count

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