Class Index
Wrap an Index Handle.
An index object is mainly used to perform scans Scan over a secondary table. It also holds the Index Info in order to retrieve some valuable information from it IndexInfo
To create an Index instance, it is neccesary to provide the table it belongs to, at the paremeter "table", and its name at the parameter "iname"
Once having an Index Instance, it is possible to create a Scan object by calling fullScan(Int32) in order to perform an scan. It is also possible to create a Scan by creating first a ScanPorperties object ScanProperties and then an Scan from it
Inheritance
Implements
Inherited Members
Namespace: lxapi
Assembly: lxapi.dll
Syntax
public class Index : IDisposable
Examples
Index scan over a string field from "111111111Q" (inclusive) to the maximum value is expressed as:
lxapi.Index index = new lxapi.Index(table, dniidx);
lxapi.Tuple min = index.tupleBuilder().add(0, 111111111Q).build(index);
ScanProperties properties = new ScanProperties(index).skRange(min, null, 0);
scan = new Scan(properties, 0);
Index full scan to retrieve the data ordered by its secondary field in reverse order
lxapi.Index index = new lxapi.Index(table, idcardidx);
scan = index.scan(null, (int)ScanPropFlags.KVReverse);
Fields
info
Index Info Handle
Declaration
public readonly IndexInfo info
Field Value
Type | Description |
---|---|
IndexInfo |
kvIdx
Index Handle
Declaration
public readonly IntPtr kvIdx
Field Value
Type | Description |
---|---|
System.IntPtr |
table
Table where the index belongs to
Declaration
public readonly Table table
Field Value
Type | Description |
---|---|
Table |
Methods
Dispose()
Dispose
Declaration
public void Dispose()
Dispose(Boolean)
Release Index Handle
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Destructor
Declaration
protected void Finalize()
fullScan(Int32)
Create a full scan on a secondary table.
No filter is applied to the table rows. It is only possible to
to indicate how the server is going to iterate over the row with
param flags
, ScanPropFlags
Declaration
public Scan fullScan(int flags = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | flags | scan type bitmask ScanPropFlags |
Returns
Type | Description |
---|---|
Scan | a new scan object |
Examples
Perform a full scan in reverse order on the secondary table
session = new Session();
table = new Table(session, "person");
index = new Index(table, "phoneidx");
Scan scan = index.fullScan((int)ScanPropFlags.KVReverse);
tupleBuilder()
Create index's tuple builder.
Declaration
public TupleBuilder tupleBuilder()
Returns
Type | Description |
---|---|
TupleBuilder |
Remarks
The tuple builder might be used to create tuples for another index or table