| ||||||||||||||||
Reference/es_mbc_addfldidxSyntaxint es_mbc_addfldidx( struct es_mbc *cls, const char *fldnm ); Arguments
Return Codes
DescriptionAdd a field to the index definition of a class. The set of all index fields must constitute a unique key for the class, unless the class is designated as The index of a class is defined when the class is created, via a call to es_mbc_new. Depending on the type of the index, one or more fields may be added to the index definition via es_mbc_addfldidx. The field must first be defined and added to the class via es_mbc_addfld. Only integer fields (i.e. 8,16,32 or 64bit integers) may form part of an index. The order in which es_mbc_addfld() is invoked determines the ordering of fields in an index. This can impact the performance of look-up operations as described in the Index Types section. /* construct root class "Sales" and add three database field definitions */ struct es_mbc *c_sales; es_mbc_new( schema, "Sales", 4096, ES_INDEX_PRIVATE, NULL, &c_sales ); es_mbc_addfld( c_sales, "ProductId", ES_FLDTYPE_I16 ); es_mbc_addfld( c_sales, "CustomerId", ES_FLDTYPE_I32 ); es_mbc_addfld( c_sales, "UnitSales", ES_FLDTYPE_F64 ); /* define ProductId and CustomerId to be the key */ es_mbc_addfldidx( c_sales, "ProductId" ); es_mbc_addfldidx( c_sales, "CustomerId" ); | ||||||||||||||||
Copyright © 2012 by Richard Brooks |