Click or drag to resize

Index Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
You can query an index to obtain a select number of columns from records matching specific filters. After an index has been created (see CreateIndex(String, IndexColumn)) the index persists in the transactional repository.
Inheritance Hierarchy

Namespace:  Telogis.GeoBase.Transactional
Assembly: (in Version:
public class Index

The Index type exposes the following members.

Public propertyFields
Gets a list of the fields in this Index.
Public propertyTable
Gets the Table used for this Index.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodQuery
Performs a query of this table using a specified index. A set of filters can also be specified to narrow the result set.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
You should create your indexes when you create your table structure. The following code snippet provides an example of how you can do this. Also, refer to TransactionalRepository(String).
 static TransactionalRepository InitRepository(String fname) {
    // if the repository file doesn't exist then it will be created
    bool created = !System.IO.File.Exists(fname);
    TransactionalRepository tr = new TransactionalRepository(fname);

    // If we created a new repository file then the repository is empty
    // and we must create the appropriate tables
    if (created)
        Console.WriteLine("Creating transactional repository structure");
        // Creating tables and indexes must occur within a transaction

        // create table(s) and some columns...

        // Create some indexes to allow us to query the table contents
            new IndexColumn[3] {
                new IndexColumn("CustomerName"),
                new IndexColumn("Address"),
                new IndexColumn("Phone")

            new IndexColumn[4] {
                new IndexColumn("Type"),
                new IndexColumn("Weight"),
                new IndexColumn("Axles"),
                new IndexColumn("Height")

        // at this point you may want to fill the table with some 
        // initial data...
        Console.WriteLine("Loaded transactional repository from disk.");
        Console.WriteLine("I didn't need to create any tables, columns or indexes.");

    return tr;
Now, by using a combination of filters you can select rows from each table using our indexes.
Index idx_customers = myCustomerTable.Indexes["name_address"];

ContainsFilter phoneContains = new ContainsFilter("Phone", "866");
EqualFilter nameIs = new EqualFilter("CustomerName", "My Corporate");
ColumnFilter[] filters = new ColumnFilter[2] { phoneContains, nameIs };

using (EnsureTransaction trans = new EnsureTransaction(myTransactionalRepository)) {

  // we can now display the address of each customer from 'My Corporate' whose phone 
  // number contains '866'
  foreach (Record r in idx_customers.Query(filters)) {
      Console.WriteLine("{0}, {1}, {2}", r["CustomerName"], r["Address"], r["Phone"]);


See Also