Change the location of the Lucene search index files

Overview

When using the default Sitefinity CMS search service (Lucene), the search index definition (configurations which content to be indexed) is stored in your website database, and the actual search index files – on the file system.

By default, the search index files are in the ~/App_Data/Sitefinity/Search/ folder. Sitefinity CMS enables you to change this location. This is useful in cases where you don’t want the search index files stored in the App_Data folder, or you want to store them on a network location and reuse them on multiple instances of your project.

Change the search index files location

Perform the following:

  1. In Sitefinity CMS backend, navigate to Administration » Settings.
  2. In the left pane, click Search.
  3. On the screen that opens, locate the Index folder configuration property, under Lucene Settings section.
  4. Enter the desired location for storing the search indexes
  5. Click Save changes.

IMPORTANT: You must specify an application relative path, for example ~/MyDesiredSearchIndexFolder. Sitefinity CMS resolves the specified path using ASP.NET API (HostingEnvironment.MapPath), and you must follow this required syntax.

IMPORTANT: You must make sure the AppPool identity, your website is running under, has read/write permissions over the specified folder.

Store search indexes on a network location

In certain scenarios you might need to store the search indexes in a location external from your website file structure. This option can be used if you want to share the search indexes among your web server nodes in a load balancing configuration. To use this option, you must add a virtual directory to your website in IIS, and have that virtual directory point to the desired network folder location. Use the alias you’ve given for your virtual directory to configure the Index folder setting in Sitefinity CMS as explained earlier in this article. For example, if your network folder is accessed at //share/MySearchIndexesFolder and you mapped a virtual directory in IIS with alias SharedSearchIndexes, you must specify ~/SharedSearchIndexes for the Index folder setting value.

NOTE: When running in load balanced setup, we recommend using a shared network folder for your search indexes only if you are not doing intensive content editing. This approach works optimally when you are not editing content at all, and you only need to ensure all nodes use the same search index files, or your content editors work on separate sections of the backend, thus the possibility for two people to edit simultaneously the same item is minimal. When multiple people edit the same item in the backend, Sitefinity CMS does not have control over the Lucene implementation for locking the index files for writing, thus some changes might not be reflected in the search index if the files are locked for editing at the moment of publishing an item. For more intensive content editing scenarios in load balanced setup we recommend using a cloud search service. For more information about using cloud search services with Sitefinity CMS see Generate and store search indexes in the cloud.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?