Overview
Identifier Results enhances the search experience for users who know specific product codes or identifiers. When a user types a pattern matching your configured identifier format (e.g., “ABC-123-XYZ”), this module fetches and displays matching products immediately, often before they finish typing.Key Features
- Pattern Detection: Configurable regex to detect identifier formats
- Auto-Highlighting: Automatically highlights matching identifier parts
- Separator Flexibility: Supports various separator characters between identifier segments
- Instant Results: Shows results as soon as pattern is detected
- Debounced Requests: Optimizes API calls while typing
- Customizable Display: Full control over result presentation
Components
IdentifierResults
The main container component that renders a list of identifier-matched results.Props
| Name | Type | Default | Description |
|---|---|---|---|
animation | Vue Component | "ul" | Animation component for list transitions |
maxItemsToRender | number | undefined | Maximum number of results to display |
Slots
default(Required): Template for each identifier result item- Bindings:
identifierResult(Result object)
- Bindings:
Events
The component automatically provides theUserClickedAIdentifierResult event to child result components.
Usage
With Animation
Custom Layout
IdentifierResult
Displays an individual identifier value with automatic highlighting of the matching portion.Props
| Name | Type | Required | Description |
|---|---|---|---|
result | Result | Yes | The result object containing identifier data |
Features
- Automatically extracts
identifier.valuefrom the result - Highlights the matching portion based on the search query
- Applies the
x-identifier-result__matching-partclass to matched text - Renders nothing if no query or identifier value exists
Usage
Custom Styling
Configuration
Configure the Identifier Results module to match your product identifier format:Configuration Options
| Option | Type | Description |
|---|---|---|
debounceInMs | number | Debounce time (ms) for query changes while typing |
maxItemsToRequest | number | Maximum number of identifier results to fetch from API |
identifierDetectionRegexp | string | Regex pattern to detect identifier format in query |
separatorChars | string | Characters that can separate identifier segments |
Regex Pattern Examples
Events
The Identifier Results module emits the following events:State Change Events
-
IdentifierResultsChanged: Identifier results updated- Payload:
Result[]- Array of identifier results
- Payload:
-
IdentifierResultsRequestUpdated: Request parameters changed- Payload:
IdentifierResultsRequest | null- Request object or null if invalid
- Payload:
User Interaction Events
UserClickedAIdentifierResult: User clicked an identifier result- Payload:
Result- The clicked result object
- Payload:
Integration Patterns
In Empathize Layer
Show identifier results alongside other suggestions:Standalone Quick Search
Create a dedicated identifier search interface:With Product Comparison
Allow users to compare multiple identifier results:Best Practices
Pattern Design
Create identifier patterns that balance precision and flexibility:Performance Optimization
Set appropriate debounce and result limits:User Feedback
Provide clear feedback about identifier format:Highlighting
Style matched portions for clarity:Case Sensitivity
Handle case variations in your pattern:Troubleshooting
Results Not Appearing
- Check regex pattern matches your query:
- Verify API returns identifier field:
Highlighting Not Working
Check separator configuration matches your identifiers:Too Many False Positives
Refine your regex to be more specific:Related Components
- Empathize - Container for predictive results
- Query Suggestions - Text-based suggestions
- Search Results - Main search results display
- Base Components - Foundational UI components
