Configuring Query Indexes
Indexes are used in querying for efficiency, and are based on the type of a class. The user may further specify the attributes of the class on which indexes are required. Query Indexes can be configured in the following ways:
Using NCache Manager
Click on the cache name in Cache Explorer to open cache settings.
Go to Query Indexes tab.
Select Query Indices wizard will open. Click Browse to browse for required assembly. Select the assembly.
Assembly and all its classes will be listed in Selected Assemblies section.
Select the required classes by checking the check box and click Add Class button.
List of selected classes along with its attributes will be listed down in List of selected Classes section. Select the attributes you want to add indexes for and click OK.
NCache Manager displays all private members and properties of selected class. Select either private members or properties.
Select Query Indexes wizard will close and selected classes and their attributes will appear in ‘Selected Classes and their attributes’ section of ‘Query Indexes’ tab.
Right click on the cache name in Cache Explorer and select Apply Configuration option.
Using Command Line Tool
Open Command Prompt and go to the NCache tools directory:
addqueryindex.exe, provide required information:
addqueryindex.exe demoLocalCache /a C:\Data.dll /c Data.Product /L ProductID$ProductName$Category$UnitsAvailable
addqueryindex.exe demoLocalCache /a C:\Data.dll /c Data.Customer /L CustomerID$CustomerName
- This will add ProductID, ProductName, Category, Supplier and UnitsAvailable attributes from the class Data.Product and Data.Customer of Data.dll in query indexes for demoLocalCache.