Add-QueryIndex
This PowerShell Cmdlet enables the user to add 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 using this PowerShell Cmdlet.
Add-QueryIndex [-CacheName] –AssemblyPath –Attributes -Class [-Server] [-Port] [-Credentials] [-NoLogo] [-Type]
Examples of Add-QueryIndex
- This command adds query index for the attributes CustomerID and FirstName in cache.
Add-QueryIndex -CacheName demoCache -AssemblyPath C:\Data.dll -Type Data.Customer -Attributes "CustomerID'$'FirstName"
- This command adds query index for the attribute CustomerID and FirstName in cache on server 20.200.20.11.
Add-QueryIndex -CacheName demoCache -AssemblyPath C:\Data.dll -Type Data.Customer -Attributes "CustomerID'$'FirstName" -Server 20.200.20.11
- This command adds JSON-based query index for the attributes CustomerID and FirstName whose data type will be Integer and String respectively in cache on server 20.200.20.11.
Add-QueryIndex -CacheName demoCache -JsonFilePath C:\data.json -Type Data.Customer -Attributes "CustomerID'$'FirstName" -AttributeTypes "Integer'$'String" -Server 20.200.20.11
Properties
Note
The parameters with asterisk (*) on their names are the required parameters and the rest are optional.
Parameters | Data Types | Description | Default Value |
---|---|---|---|
-CacheName* |
<String> |
Specifies the name of the cache for which query indexing needs to be done. | - |
-AssemblyPath* |
<String> |
Specifies the path of the assembly which needs to be configured. | - |
-Attributes* |
<String> |
Specifies the attributes for query indexing. If multiple attributes need to be indexed; they are separated by a ‘$’. | - |
-Class* |
<String> |
Specifies the fully qualified class name for query indexing. | - |
-Server |
<String> |
Specifies the NCache server name where the NCache Service is running. | - |
-Port |
<Integer> |
Specifies the server port where NCache Service is listening. | 8250 |
-Credentials |
<pscredential> |
Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user with the appropriate permissions at the node. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |
-Type* |
<String> |
Specifies the name of the Class/Type for which query index will be configured. | - |