Add-QueryIndex - PowerShell Cmdlet
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 in this PowerShell Cmdlet.
Note
This feature is only available in NCache Enterprise.
Note
Please note that when using the NCache .NET Edition, you will require .dll libraries instead of .jar assemblies for this PowerShell Cmdlet.
Add-QueryIndex [-CacheName] –AssemblyPath –Attributes -Class [-Server] [-Port] [-Credentials] [-NoLogo]
Examples of Add-QueryIndex - PowerShell Cmdlet
- This command adds query index for the attributes CustomerID and FirstName in cache.
Add-QueryIndex -CacheName demoCache -AssemblyPath C:\Data.jar -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.jar -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 for query indexing. | - |
-Server |
<String> |
Specifies the NCache server name where the NCache Service is running. | - |
-Port |
<Integer> |
Specifies the server port where NCache server is listening; if the server channel is not using the default port. | 8250 |
-Credentials |
<pscredential> |
Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user who has appropriate permissions at the node. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |