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
- Definition: Operations are the basic building blocks that define how data is tokenized or transformed
- Types:
- Unit of Measurement Operator: Tokenizes data by unit type
- RegEx Operator: Tokenizes and transforms data based on predefined Regular Expression
Normalizers
- Definition: Actions applied to fields to link the defined Operations to specific data fields
- Types:
- Search Context: Normalizes data for search queries without modifying the indexed data
- Indexing Context: Normalizes data during indexing by converting data into a standardized format
Field Assignments
- Definition: Assigns Normalizers to individual fields, enabling specific normalization behaviors during search, faceting, and sorting
- Types:
- Search Normalizer: Applied during query execution
- Facet Normalizer: Converts facet values into standardized formats
- Sort Normalizer: Prepares data for sorting operations if the field is sortable
The relationship between these components is hierarchical:
Operations > Normalizers > Field Assignments
- Operations define how data is transformed
- Normalizers group and apply Operations to fields
- Field Assignments configure which fields should leverage specific Normalizers during searches, faceting, and sorting
Operation Examples
Unit of Measurement Operation
Task | Unit of Measure Type | Unit of Measure | Example Original Value | Example Transformed Value |
---|---|---|---|---|
Convert inches to feet | Length | Foot (ft) | 12 in | 1 ft |
Convert pounds to kilograms | Weight | Kilogram (kg) | 220 lbs | 99.79 kg |
Convert gallons to liters | Volume/Capacity | Liter | 1 gal | 3.785 L |
Convert farads to microfarads | Capacitance | Microfarad (μF) | 0.001 F | 1000 μF |
Convert amperes to milliamperes | Current | Milliampere | 2 A | 2000 mA |
Convert ohms to kiloohms | Electric Resistance | Kiloohm (kΩ) | 1000 Ω | 1 kΩ |
Convert volts to kilovolts | Electric Potential | Kilovolt (kV) | 1000 V | 1 kV |
Convert watts to kilowatts | Power | Kilowatt (kW) | 1500 W | 1.5 kW |
Convert Fahrenheit to Celsius | Temperature | Celsius (°C) | 100 °F | 37.78 °C |
Convert PSI to Bar | Pressure | Bar (bar) | 14.7 psi | 1 bar |
Convert cubic feet per minute to liters per second | Volumetric Flow | Liters per Seconds (L/s) | 35.31 cu ft/min | 16.666 L/s |
RegEx Operation
Task | RegEx | Replacement | Example Original Value | Example Transformed Value |
---|---|---|---|---|
Dash to space | ([0-9]{1})-([0-9]{1}) | $1 $2 | 1-3/4 | 1 3/4 |
Remove dashes | ([0-9]{1})-([0-9]{1}) | $1$2 | 999-9 | 9999 |
Remove special characters and spaces | (\w)?\W | $1 | 999#999 | 999999 |
Normalize all cases to uppercase | (.*) | Conversion type: Uppercase | hello world | HELLO WORLD |
Normalize all cases to lowercase | (.*) | Conversion type: Lowercase | HELLO WORLD | hello world |
Normalize all cases to first-character uppercase | (\w)(\w*) | \U$1\L$2 | hEllO WorLD | Hello World |
Format SKU with consistent dashes | ([A-Za-z0-9]{4})([A-Za-z0-9]{4})([A-Za-z0-9]{4}) | $1-$2-$3 | ABCD1234EFGH | ABCD-1234-EFGH |
Convert °F into °F | (-?.*\d)\s?&(amp;)?deg;F | $1 °F | 160°F | 160 °F |
Updated 3 months ago