Create a Distributed Lucene with Persistence Cache
A Distributed Lucene with Persistence cache deals with Lucene-based indexing and searching of documents. NCache allows you to specify your store type as Distributed Lucene with Persistence through the NCache Management Center and PowerShell. This section will explain how you can create a Distributed Lucene with Persistence cache.
For Distributed Lucene with Persistence, it's strongly encouraged that you use an SSD to store your indexes instead of an HDD.
Using the NCache Management Center
Launch the NCache Management Center by browsing to http://localhost:8251 or
<server-ip>:8251on Windows and Linux.
In the left navigation bar, click on Clustered Caches. This opens up the Clustered Caches page at
To create a new Distributed Lucene with Persistence cache, click on New.
- From the In-Memory Store Type dropdown menu, select Distributed Lucene with Persistence and specify the name of your cache. Click Next.
Distributed Lucene with Persistence supports JSON serialization only.
- Select the caching topology and set any advanced options like Operation Timeout and Statistic Replication Interval. Click Next.
Distributed Lucene with Persistence only supports the Partitioned Topology in NCache Professional.
- Specify the Cache Partition Size of the cache and add your cluster nodes by specifying the Server Node IP of the machine and clicking on the Add Node button. To add more nodes, specify IP and then click the Add Node button again. Click Next once all the required nodes are added.
Cache size doesn't matter much in Distributed Lucene with Persistence as all documents are stored on a disk instead of the actual cache itself.
- You have two options, Create new indexes or Use existing indexes. Choose the former option and specify your index path in the field next to the Index Path label. The default path is C:\ProgramData\ncache\lucene-index. Once done, click on Validate Path. Once your Index Path has been validated, you will be prompted with a success notification and the path will be updated as C:\ProgramData\ncache\lucene-index\demoClusteredCache. Click Next.
Unless the index path has been validated successfully, you can't proceed further with the cache creation process.
- Change the Cluster Port and Port Range if required. Click Next.
In the Advanced Options page, you can configure the following settings:
You can change the Default Priority of eviction from the dropdown list.
You can also change the Eviction percentage by changing the value of the field next to the Eviction Percentage label.
You can change the Clean interval value. The default is 15 seconds.
This cache can be started automatically upon the completion of this process if you have checked the Start this cache on Finish checkbox.
This cache will start automatically after service restart if you check the Auto start this cache on service startup.
- Click Finish to complete the process. Your created cache will appear on the Clustered Caches page with the server nodes and their status and a success notification will be displayed in the notification panel.
You can also use PowerShell to manage Distributed Lucene with Persistence caches by using the NCache supported PowerShell cmdlets.
The New-Cache PowerShell cmdlet is responsible for creating new caches.
The following command creates a cache named demoClusteredCache on the nodes 184.108.40.206 and 220.127.116.11. The
InMemoryStoreType is specified as DistributedLuceneWithPersistence and the
LuceneIndexPath provided is C:\ProgramData\ncache\lucene-index. The
Topology is set as Partitioned.
New-Cache -Name demoClusteredCache -Server "18.104.22.168,22.214.171.124" -Size 1024 -InMemoryStoreType DistributedLuceneWithPersistence -LuceneIndexPath "C:\ProgramData\ncache\lucene-index\" -Topology Partitioned
The Start-Cache PowerShell cmdlet is responsible for starting already created caches.
The following command starts the Distributed Lucene with Persistence cache demoClusteredCache created previously on the node 126.96.36.199.
Start-Cache demoClusteredCache -Server 188.8.131.52