Refiner Mapper Stage: Map Your Metadata Refiner Values
Use the following information to map your metadata refiner values across all search engines and backends.
- The Refine Mapper stage is a pipeline stage that maps backend The search engine your SmartHub instance uses to perform queries. SmartHub can be configured to use more than one search engine. refinement names and values to match the local refinements.
- To get the results you expect, this pipeline stage Pipeline stages offer uniformity to the end user. Various functions include mapping names and values to match local refinements. must be added to both the Query and Results pipeline stages.
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 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
- If the Refinement Mapper is set before the Property Mapper in the Query Pipeline stage, it must use PropertyA for mappings.
- 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
- If the Refinement Mapper is set after the Property Mapper in the Query Pipeline stage, it must use PropertyB for mappings.
- Refinement Mapper 1st:
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:
- Property Mapper
- Refinement Mapper
Results Pipeline stage:
- Refinement Mapper
- Property Mapper