Custom Index

A Custom Index is (as the Standard Index) of type sv:nodeIndex. It can be placed on a specific sv:site or on the Sitevision server. A Custom Index on the server can handle data of multiple sites below the server object.

Custom Index requires license feature "Search Advanced" or "Search Enterprise".

Search Advanced will allow a single Custom Index per site.

Search Enterprise will allow multiple Custom Indexes, both on sites and on the server. It will also allow index field configuration (Add/Update/Remove) and the option to open the Custom index pipeline for external data management (Add/Update/Remove) via the Solr API.

When a Custom Index is created, it will be a carbon copy of the current Standard Index. Indexed data types will initially be identical:

  • sv:sitePage
  • sv:page
  • sv:article
  • sv:structurePage
  • sv:collaborationGroupPage
  • sv:file
  • sv:image

When using Search Enterprise and allowing external data, it can also contain external data. The pipeline will demarcate all such data as "external" in the svtype field.

The Custom Index must be explicitly specified (i.e. via SearcherBuilder.setIndex) when querying it via Searcher in the API. The Custom Index is typically fetched via IndexUtil.

var searchFactory = require('SearchFactory');

// Get the Custom index
var indexUtil = searchFactory.getIndexUtil();
var customIndex = indexUtil.getIndexByName('Name of the Custom Index');

if (customIndex) {
   // Create appropriate permission check (needed if custom index contains external, permissioned data)
   var permissionCheck = searchFactory.getPermissionCheckBuilder().build();   
   
   var searcher = searchFactory.getSearcherBuilder()
                    .setPermissionCheck(permissionCheck)
                    .setIndex(customIndex) // Set index
                    .build();

   var searchResult = searcher.search('the query', 10);
   /* handle search result... */   
} else {
   /* handle what to do when there's no such index available */
}

Fields

The index fields are initially a carbon copy of the index fields in the Standard Index.

Search Advanced

The Search Advanced license feature doesn't allow any field configuration.

Search Enterprise

The Search Enterprise license feature allows for advanced index field configuration (Add/Update/Remove).

Typically new fields are added to hold additional external data that is injected via the Solr API through the index pipeline. New fields can also be added with the purpose of make indexing more precise for certain cases (e.g. "index embedded file metadata X for pdf files in field my-pdf-x-field").

The svtype field

The pipeline will demarcate all external data as "external" in the svtype field.

The lastindexed field [@since 2023.09.1]

The indexing process will set the timestamp data in the lastindexed field for external data (if not explicitly provided).