Concepts Explained and Examples

Understanding the Concept

Feature Overview

Measurement Conversion is designed to standardize and normalize data for improved search relevancy. It consists of the following main components:

Operations

  1. Definition: Operations are the basic building blocks that define how data is tokenized or transformed
  2. Types:
    1. Unit of Measurement Operator: Tokenizes data by unit type
    2. RegEx Operator: Tokenizes and transforms data based on predefined Regular Expression

Normalizers

  1. Definition: Actions applied to fields to link the defined Operations to specific data fields
  2. Types:
    1. Search Context: Normalizes data for search queries without modifying the indexed data
    2. Indexing Context: Normalizes data during indexing by converting data into a standardized format

Field Assignments

  1. Definition: Assigns Normalizers to individual fields, enabling specific normalization behaviors during search, faceting, and sorting
  2. Types:
    1. Search Normalizer: Applied during query execution
    2. Facet Normalizer: Converts facet values into standardized formats
    3. Sort Normalizer: Prepares data for sorting operations if the field is sortable

The relationship between these components is hierarchical:

Operations > Normalizers > Field Assignments

  1. Operations define how data is transformed
  2. Normalizers group and apply Operations to fields
  3. Field Assignments configure which fields should leverage specific Normalizers during searches, faceting, and sorting

Operation Examples

Unit of Measurement Operation

TaskUnit of Measure TypeUnit of MeasureExample Original ValueExample Transformed Value
Convert inches to feetLengthFoot (ft)12 in1 ft
Convert pounds to kilogramsWeightKilogram (kg)220 lbs99.79 kg
Convert gallons to litersVolume/CapacityLiter1 gal3.785 L
Convert farads to microfaradsCapacitanceMicrofarad (μF)0.001 F1000 μF
Convert amperes to milliamperesCurrentMilliampere2 A2000 mA
Convert ohms to kiloohmsElectric ResistanceKiloohm (kΩ)1000 Ω1 kΩ
Convert volts to kilovoltsElectric PotentialKilovolt (kV)1000 V1 kV
Convert watts to kilowattsPowerKilowatt (kW)1500 W1.5 kW
Convert Fahrenheit to CelsiusTemperatureCelsius (°C)100 °F37.78 °C
Convert PSI to BarPressureBar (bar)14.7 psi1 bar
Convert cubic feet per minute to liters per secondVolumetric FlowLiters per Seconds (L/s)35.31 cu ft/min16.666 L/s

RegEx Operation

TaskRegExReplacementExample Original ValueExample Transformed Value
Dash to space([0-9]{1})-([0-9]{1})$1 $21-3/41 3/4
Remove dashes([0-9]{1})-([0-9]{1})$1$2999-99999
Remove special characters and spaces(\w)?\W$1999#999999999
Normalize all cases to uppercase(.*)Conversion type: Uppercasehello worldHELLO WORLD
Normalize all cases to lowercase(.*)Conversion type: LowercaseHELLO WORLDhello world
Normalize all cases to first-character uppercase(\w)(\w*)\U$1\L$2hEllO WorLDHello World
Format SKU with consistent dashes([A-Za-z0-9]{4})([A-Za-z0-9]{4})([A-Za-z0-9]{4})$1-$2-$3ABCD1234EFGHABCD-1234-EFGH
Convert °F into °F(-?.*\d)\s?&(amp;)?deg;F$1 °F160°F160 °F