• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Create a Distributed Lucene Cache

A distributed Lucene cache deals with Lucene-based indexing and searching of documents. NCache allows you to specify your store type as distributed Lucene through the NCache Web Manager and PowerShell. This section will explain how you can create a Distributed Lucene cache.

Important

For Distributed Lucene, it's strongly encouraged that you use a SSD to store your indexes instead of a HDD.

Using NCache Web Manager

  • Launch NCache Web Manager by browsing to http://localhost:8251 or <server-ip>:8251 on Windows and Linux.

  • 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 cache, click on New.

NCache Web Manager Clustered Caches

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

Distributed Lucene supports JSON serialization only.

Distributed Lucene 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 Cache Step 2

  • Specify the Cache Partition Size of the cache and add your cluster nodes by specifying the Server Node IP or Hostname of the machine and clicking on +. To add more nodes, click +. 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 indexes and Use existing indexes. Chose 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 path will be updated as C:\ProgramData\ncache\lucene-index\demoClusteredCache. 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. Enable pipelining for the cache if required by checking the Enable Pipelining checkbox. Set the Batch Interval for the duration after which the commands will be transmitted over the network in microseconds. Click Next.

Distributed Lucene 5

  • If you want to enable encryption and compression, check the Enable Encryption and Enable Compression checkboxes. If enabled, set the Providers and Key for encryption and Threshold Size for compression. Click Next.

Distributed Lucene 6

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

    • Eviction is disabled by default. You can enable it by checking the Enable Eviction checkbox. Configure the Eviction Policy accordingly.

    • 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. Default is 15 seconds.

    • This cache can be started automatically upon the completion of this process if you have check 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 in Clustered Caches page with the server nodes and their status and a success notification will be displayed in the notification panel.

Distributed Lucene 8

Using PowerShell

You can also use the PowerShell to manage distributed Lucene 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 demoClusteredCache on the nodes 20.200.20.40 and 20.200.20.39. The InMemoryStoreType is specified as DistributedLucene and LuceneIndexPath provided is C:\ProgramData\ncache\lucene-index. The Topology is set as PartitionedOfReplica.

New-Cache -Name demoClusteredCache -Server "20.200.20.40,20.200.20.39" -Size 1024 -InMemoryStoreType DistributedLucene -LuceneIndexPath "C:\ProgramData\ncache\lucene-index\" -Topology PartitionedOfReplica

Start Cache

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

The following command starts the distributed Lucene cache demoClusteredCache created previously on the node 20.200.20.40.

Start-Cache demoClusteredCache -Server 20.200.20.40

See Also

Add Local/Remote Clients
Monitor Caches
NCache Programmer's Guide
NCache PowerShell Guide

Back to top Copyright © 2017 Alachisoft