Depending on the indexed data set for InSite Search, the default behavior may result in large, complex queries. The DocumentBoostsByFacets feature improves performance and focuses search result sets by providing administrators with the means to target query fields. Administrators can specify certain fields from documents indexed by the CMS with the DocumentBoostsByFacets configuration file. When you boost a field, the content containing the boosted field will rank higher than other matching content in the score calculation formula, provided all other factors are equal.

Because this feature affects index-time boost score calculation, you will need to delete and then re-index your publish content when either the feature is first enabled, or each time an adjustment is made to the configuration file for this feature. For this reason, it's recommended that you test your adjusted values in a test environment prior to implementing changes in production environments.

To configure DocumentBoostsByFacets.xml:

  1. Open your DSS project in Visual Studio, and update to the latest version of InSite Search 2 via NuGet Package Manager.
  2. Rebuild your VS project.
  3. Download the following sample configuration file: DocumentBoostByFacets.xml.
    <FacetBoosts enabled ="true">
    	<!--Sample Facet value below: the fieldName "_CATS_ID", which is Taxonomy, is delimited 
    		with spaces in the Lucene index.Each Boost term corresponds with a Taxonomy ID for
    		each page. Boost Values should be values between 0 and 4 -->
    	<Facet fieldName="_CATS_ID" delimited="true" delimitor="space">
    		<Boost value="184" boostValue="3" />
    		<Boost value="481" boostValue="2.6" />
  4. Open DocumentBoostByFacets.xml in an editor and verify that the root element's enabled attribute is set to true.
  5. Modify the configuration file to include additional elements.
    1. Each element needs to include the following attributes:
      • fieldName: The name of the field within which the targeted terms are located. Usually, this is the CMS element name value (e.g., BodyCopy, SEO_Words, _CATS_ID).
      • delimited: True indicates that the field is a list of delimited values; whereas, false indicates it is a single value.
      • delimitor: This option only supports lists that are delimited with spaces or commas. In the case of space-delimited values, the configuration value must be space.
    2. For each element, add an element to define the term for boosting against, as well as the boostValue to add.

      Important: Keep boostValue within the range of 1-4.

  6. Save your configuration file to your DSS server.
    Note: If you save DocumentBoostByFacets.xml to the Config folder (e.g., [Drive]:\[path to DSS root folder]\Config\DocumentBoostByFacets.xml), then you can skip the next step -- you do not need to configure Search.config -- because the Config folder is the file's default location.
  7. In Search.config, include an add tag within Settings, then set the following attributes:
    • Name: DocumentBoostByFacetsFileLocation
    • Value: Enter an absolute path to the configuration file as it resides on the DSS server after replication (e.g., [Drive]:\[path to DSS root directory]\[subfolder(s)]\DocumentBoostByFacets.xml).
  8. Save Search.config.
  9. After the initial configuration of DocumentBoostByFacetsFileLocation, recycle the DSS application pool so that the system can pick up the new file's location. All subsequent changes to DocumentBoostByFacets.xml will be reflected in search results.