Import Lucene Indexes
NCache provides you with PowerShell cmdlets to import native Lucene indexes to your distributed Lucene cache and copy the indexes from one distributed Lucene cache to another. This section will explain how to use these cmdlets along with some examples. NCache provides these tools to enable flexible and easy index migration for your distributed Lucene caches.
Note
Both of the tools, Import Lucene Index and Import Distributed Lucene Index are only supported for Partitioned Topologies.
Import-LuceneIndex
Important
If you're using a Partition-Replica topology, you must have double the free space available at the given path (where indexes are being imported), and read/write permissions are enabled on this path.
The Import Lucene Index tool enables users to load native indexes to the distributed Lucene cache to avoid re-indexing of the relevant data.
Important
Ensure your cache(s) stops and the NCache Service is running.
Examples of the Import Lucene Index Tool
This example command loads the native Lucene index to a distributed Lucene store demoCache
Import-LuceneIndex -TargetCache demoCache -Path C:\ProgramData\ncache\lucene-index\{CACHE_NAME}\data -Server 20.200.20.40
Import-DistributedLuceneIndex
The Import Distributed Lucene Index tool imports Distributed Lucene indexes from a Distributed Lucene cache to another Distributed Lucene cache. This tool overwrites the existing named indexes that have been predefined on the cache. If you have the same index name in the source and target cache, then this tool overwrites that index in the target cache. This will not work if:
- You don't have enough space on the target location (the cache indexes are being copied too).
- A state transfer is pending.
Important
Before running this cmdlet, ensure the following:
- The NCache service is running on both SourceCache and TargetCache.
- The SourceCache and TargetCache nodes are stopped.
Examples of Import-DistributedLuceneIndex
This example command copies the distributed Lucene index from the Source Cache located at server 20.200.20.39* to the Target Cache located at server 20.200.20.40.
Import-DistributedLuceneIndex -SourceCache sourceCache -TargetCache targetCache -SourceCacheServer 20.200.20.39 -TargetCacheServer 20.200.20.40