Backend search index
Overview
Enabling the Backend search index allows for more comprehensive search results in the backend. When the index is not activated (default behavior), your search only looks in the titles of media content items. If you activate the index, in addition to the search results from titles, you also get search results from library name, tag, category, and file URL.
NOTE: The backend search index only works for media content items and by default, it is inactive. The scope of the backend search index is read-only (cannot be modified).
To implement search for other fields, use the sample Extending search functionality in AdminApp on Sitefinity GitHub repository.
Activate backend search index
The backend search functionality is enabled by default, but the backend search index must be activated so you can get search results other than media item titles. To do this, perform the following:
- Navigate to Administration » Search indexes.
There is an index named Backend search that, by default, is inactive.
- Expand the Actions menu of the Backend search and click Reindex.
The operation may be time consuming. While the operation is running, you see the reindexing status progress.
RESULT: Once the reindexing is completed, the Backend search index becomes active and you can start using media search with more comprehensive results.
To configure the backend search functionality, perform the following:
- Navigate to Administration » Settings » Advanced » Search.
- To enable or disable the backend search, select/deselect Enable backend search.
- Click Save changes.
Reduce the size of the backend search index
If you have a big database with lots of master items, the backend search index size may increase significantly, which may be costly in cloud deployments. In such scenario, you can configure Sitefinity CMS to not store different versions for Live and Master items and reduce the size of the backend search index.
To turn on this setting, perform the following:
- In Visual Studio, open your Sitefinity CMS project.
- Expand App_Data » Sitefinity » Configuration and open
SearchConfig.config
.
- Search for the
searchConfig
tag and add this attribute: disableIndexingLifecycleVersions="true"
After the modification your config file should look like this:
- Build and deploy your Sitefinity CMS solution.
Find media items
The backend search works for images, videos, and documents. To use it, navigate to the Images, Videos, or Documents & Files page.
The search performs a startswith
on each term with an AND between terms. The search looks at titles, tags, categories, file URLs, and library names. URL searches return whole word results from the relative URL of the item.
EXAMPLE: If you have an image with the following URL www.mysite.com/image-album/my-image.png, the search looks only in the /image-album/my-image.png part of the URL and returns results for image, album, my, image, my-image.png and /image-album/my-image.png inputs. You can also search with .png input and the search returns all images with the .png extension but also terms that start with png.
This search behavior is consistent with the default frontend search behavior. For more information, see Site search.
Improve media items location
The Backend search index also improves the process of locating media items - such as images, documents, and videos - on pages and links to media items in the New UI. Once the index is activated and reindexed, you can see where media items are used or linked to from the Actions menu of the media item. The results are displayed in the Pages displaying this… media type for images, documents, and videos. For more information, see Image actions, Document actions, and Video actions.
After activating the index, media items are tracked in the following locations:
- Content blocks
Media and content links in content blocks are tracked after activating the index.
- Long-text fields
Media and content links in long-text fields are tracked after activating the index.
- Page templates
Pages with page templates with media widgets and content blocks with relations to media items are tracked after activating the index.
- Forms
Forms with content blocks that have media items relations are tracked after activating the index.
- Content items
Long-text fields in content items, such as news, lists, list items, blogs, blog posts, events, media items, custom content and pages are tracked after activating the index. If the index is not activated, only media items in the related media fields are tracked. For more information, see Add related data and related media.
These relations are displayed in the Items displaying this… media type pages available from the Actions menu of the media type. For more information, see Image actions, Document actions, and Video actions.
This is in addition to media widgets, such as the Image and Video widgets and gallery widgets, and related media custom fields that are already tracked even if the index is not active.
EXAMPLE: You have several pages that display the same image in different ways. One of the pages displays it with the
Image widget. Another one has it inserted in a content block. Other pages include it as a link or in long-text fields.
To see all the pages where this image is used you have to perform the following:
- Navigate to Content » Images.
- Browse the libraries to find the image or use the search box.
- Select the image and expand the Actions menu.
- Click Pages displaying this image.
The Pages displaying image page appears. Here you can see a list with links to all the pages displaying this image.
If you want to see all the items linking or displaying this image, click Items displaying this image instead.
The Items displaying image appears with a list with links to all the content items displaying this image.