Configure 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.
In order to get more detailed explanation of query indexing, please see the Query Indexing section.
Add Query Indexes
Add-QueryIndex cmdlet adds query indexes for the objects to be added in the cache. These Query Indexes can later be used by the user to search for items in the cache.
This command adds a query index for the Customer
class for attributes CustomerID
, FirstName
and City
for a cache named demoClusteredCache.
Note
All attributes are separated with a '$'
.
Add-QueryIndex -CacheName demoClusteredCache -AssemblyPath C:\\Data.dll -Class Data.Customer –Attributes CustomerID'$'FirstName'$'City
Any objects of the Customer class added to cache will be retrieved via these indexes.
In order to avoid unnecessary memory consumption and optimize NCache performance make sure to index the required classes and their properties only.
Remove Query Indexes
Remove-QueryIndex cmdlet enables the user to remove pre-defined query indexes for the objects to be added in the cache.
This command removes a query index for the Customer
class for attributes CustomerID
, FirstName
and City
for a cache named demoClusteredCache.
Note
All attributes are separated with a '$'
.
Remove-QueryIndex -CacheName demoClusteredCache -Class Data.Customer –Attributes CustomerID'$'FirstName'$'City
See Also
Remove Server Node
Add Data Source Providers
Update Cache Config