Try Playground
Show / Hide Table of Contents

Create 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 through the NCache Management Center and PowerShell. This section will explain how you can create a Distributed Lucene with Persistence Cache.

Important

For Distributed Lucene, 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 <server-ip>:8251.

  • In the left navigation bar, click on Clustered Caches. This opens up the Clustered Caches page at <server-ip>:8251/ClusteredCaches/.

  • To create a new Distributed Lucene with Persistence cache, click on New.

NCache Web Manager Clustered Caches

  • From the In-Memory Store Type dropdown menu, select Distributed Lucene with Persistence and specify the name of your cache. Click Next.
Note

Distributed Lucene supports JSON serialization only.

Distributed Lucene with Persistence Cache Step 1

  • Select the caching topology and set any advanced options like Operation Timeout and Statistic Replication Interval. Click Next.
Note

Distributed Lucene only supports the Partitioned and Partition-Replica Topologies.

Distributed Lucene with Persistence Cache Step 2

  • 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 Add Node. To add more nodes, click Add Node. Click Next once all the required nodes are added.
Note

Cache size doesn't matter much in Distributed Lucene as all documents are stored on a disk instead of the actual cache itself.

Distributed Lucene 3

  • You have two options, Create new index directories or Use existing index directories. Choose the former option and specify your index path in the field next to the Index Path label. The default path is /user/share/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 /user/share/ncache/lucene-index/cache_name. Click Next.
Warning

Unless the index path has been validated successfully, you can't proceed further with the cache creation process.

Distributed Lucene 4

  • Change the Cluster Port and Port Range if required. Click Next.

Distributed Lucene 5

  • In the Advanced Options page, you can configure the following settings:

    • You can 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.

Distributed Lucene 7

  • 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.

Distributed Lucene 7

Using PowerShell

You can also use PowerShell to manage Distributed Lucene with Persistence Caches by using the NCache supported PowerShell cmdlets.

Create Cache

The New-Cache PowerShell cmdlet is responsible for creating new caches.

The following command creates a cache named demoLuceneCache on the nodes 20.200.20.39 and 20.200.20.40. The InMemoryStoreType is specified as DistributedLuceneWithPersistence and the LuceneIndexPath provided is /user/share/ncache/lucene-index. The Topology is set as Partitioned.

New-Cache -Name demoLuceneCache -Server "20.200.20.39,20.200.20.40" -Size 1024 -InMemoryStoreType DistributedLuceneWithPersistence -LuceneIndexPath "/user/share/ncache/lucene-index" -Topology Partitioned

Start Cache

The Start-Cache PowerShell cmdlet is responsible for starting already created caches.

The following command starts the Distributed Lucene with Persistence Cache demoLuceneCache created previously on the node 20.200.20.39.

Start-Cache demoLuceneCache -Server 20.200.20.39

See Also

Create a Distributed Cache
Create a Pub/Sub Messaging Cache

Back to top Copyright © 2017 Alachisoft