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 scan(ScanProperties, 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
Inherited Members
Namespace: lxapi
Assembly: lxapi.dll
Syntax
public class Index
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 = new TupleBuilder(s[k]).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);
Constructors
Index(Table, String)
Retrieve Index object from a table object by its name
Declaration
public Index(Table table_, string iname)
Parameters
Type | Name | Description |
---|---|---|
Table | table_ | |
System.String | iname |
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 |
Methods
Finalize()
Release Index Handle
Declaration
protected void Finalize()
scan(ScanProperties, Int32)
Create a scan from an index object.
Note that the properties
parameter might be null so the server
will perform a full scan
Note also that properties
should be created with the same Index object
as the current one when it is not null. Scan constructor Scan migth be used instead
Declaration
public Scan scan(ScanProperties properties = null, int flags = 0)
Parameters
Type | Name | Description |
---|---|---|
ScanProperties | properties | Filter ScanProperties |
System.Int32 | flags | scan type bitmask ScanPropFlags |
Returns
Type | Description |
---|---|
Scan | a new scan object |