Refiner Mapper Stage: Map Your Metadata Refiner Values

Use the following information to map your metadata refiner values across all search engines and backends.

More information about pipeline stages and the order in which to set the Refiner Mapper stage, below.

Refiner Mapper Pipeline Stage

The Refiner Mapper pipeline stage normalizes the refiner name values in order to ensure consistency across all of your backends.

This stage is not compatible with the search within feature for refiners. Although SmartHub will not return any error, the resulting query generated will not work as expected.

This stage modifies the query RefinementFilters and the RefinementResults parts of the SearchResults object.

Two configuration modes are available (more information below):

  • Manual mode
  • File mode


To get your expected results, you must add the Refinement Mapper pipeline stage as both a Query and Results pipeline stage.

In case you want to use a facet that returns values with a space inside (example: ContentType), for each space you must add '\n'.

For refiners like "Authors" that contain the character '\' in the stage, the character '\' must be doubled: '\\'.

Pipeline Stage Parameter Syntax

Manual mode

Provide mappings on separate lines in the following format:

  • Property#OriginalName1|OriginalValue1|...#MappedName|MappedValue

Example:

  • FileType#docx|docx|doc|doc#Word|Word

File mode

Provide a file path relative to the SmartHub deployment directory, for a file that contains mappings in the same format as above.

Example

  • SmartHub directory: C:\SmartHub
  • Path for file containing mappings: C:\SmartHub\MyMappings\file.txt
  • File path in Refinement Mapper: ~/MyMappings/file.txt

Example: Microsoft Word Documents

For example, enter the following code, on separate lines, in the format:

Property#OriginalName1|OriginalValue1|...#MappedName|MappedValue

  • To map the document file types .doc and .docx to the name "Word" and .xlsx and .xls to the name "Excel" enter the following code:

FileType#docx|docx|doc|doc#Word|Word
FileType#xlsx|xlsx|xls|xls#Excel|Excel

  • Mapped values
    • Not grouped (you will see 2 occurrences of Word among your refiner values for the above example)
    • Must be duplicated:
      • Example: xlsx|xlsx|xls|xls

Order of Pipeline Stages

This pipeline stage's positioning in the pipeline relative to the Property Mapper stage is important.

For the sake of example, assume the following mappings:

Query Pipeline

  • PropertyA, PropertyB; (set in the Property Mapper pipeline stage):
    • Refinement Mapper 1st:
      • If the Refinement Mapper is set before the Property Mapper in the Query Pipeline stage, it must use PropertyA for mappings.
        For example: PropertyA#Value1|Value1#Value2|Value2
    • Refinement Mapper 2nd:
      • If the Refinement Mapper is set after the Property Mapper in the Query Pipeline stage, it must use PropertyB for mappings.
        For example: PropertyB#Value1|Value1#Value2|Value2

Results Pipeline

The order of the Refinement Mapper and Property Mapper pipeline stages must be in reversed when comparing them in the Query vs. Results pipeline stages.

See the example below.

Example

Query Pipeline stage:

  1. Property Mapper
  2. Refinement Mapper

Results Pipeline stage:

  1. Refinement Mapper
  2. Property Mapper