Overview
The Semantic Queries module provides AI-powered alternative search queries when the original query returns few or no results. This helps users:- Find relevant results when their query is too specific
- Discover related search terms
- Reformulate unsuccessful searches
- Explore semantically similar queries
- Reduce zero-results experiences
When to Use
Implement semantic queries when you need to:- Handle low or no-results scenarios gracefully
- Suggest alternative search terms to users
- Improve query refinement workflows
- Reduce search abandonment rates
- Help users discover related products/content
- Provide semantic search assistance
Configuration and Setup
Basic Setup
Add theSemanticQueries component to display alternative queries:
Configuration Options
Configure the module behavior:API Reference
Configuration Interface
Store State
Store Getters
Store Actions
Store Mutations
Events
SemanticQuery Type
Examples
Basic Semantic Queries Display
Display a list of semantic query suggestions:Custom Suggestion Layout
Customize how semantic queries are displayed:With Query Previews
Show result previews for each semantic query:No Results Fallback
Show semantic queries as a fallback for no results:Conditional Display Based on Threshold
Show semantic queries only when results are below threshold:Limit Number of Suggestions
Control how many semantic queries to display:Track Semantic Query Selection
Track when users select semantic queries:Advanced Usage
Custom Semantic Query Component
Build a custom semantic query component:Integrate with Related Tags
Combine semantic queries with related tags:Request Optimization
The module automatically:- Debounces requests based on query changes
- Clears queries when user clears search
- Updates total results from search response
- Includes extra params in requests
Backend Integration
Your backend endpoint should:Best Practices
- Set appropriate threshold - Test different thresholds to find optimal value
- Limit number of suggestions - Show 3-5 semantic queries to avoid overwhelming users
- Show similarity scores - Help users understand relevance of suggestions
- Include query previews - Show sample results for each semantic query
- Track selections - Measure which semantic queries are most helpful
- Handle no suggestions - Have fallback UI when no semantic queries available
- Test with real queries - Validate suggestions make semantic sense
- Consider performance - Semantic queries may add latency to no-results scenarios
- A/B test presentation - Experiment with different ways to display suggestions
- Monitor effectiveness - Track if semantic queries reduce abandonment
