Skip to main content

Overview

Search Rules provide a powerful way to customize how search requests are processed based on specific conditions. Unlike static search configurations, Search Rules evaluate targeting conditions at query time and apply modifications dynamically, giving you fine-grained control over the search experience.
Search Rules replace the legacy Query Rules feature with expanded capabilities including support for all request types, advanced targeting conditions, and multiple action types.

How Search Rules Work

When a search request is received, the system evaluates all enabled Search Rules in priority order. Rules that match the targeting conditions have their actions applied to the request before execution. This allows you to transform queries, inject filters, adjust tuning parameters, or override sort orders based on the context of each search.

Request Types

Search Rules can be configured to apply to specific types of search requests: All Search Types applies the rule to every search request regardless of type. Text Search targets traditional keyword-based searches. Image Search applies to visual search requests where users search by uploading an image. Similar Search targets requests for finding products similar to a specific item. Browse applies to collection browsing requests. You can select multiple request types for a single rule, allowing flexible targeting across different discovery experiences.

Targeting Conditions

Targeting conditions determine when a Search Rule should be applied. Conditions can be combined using AND/OR logic for complex matching scenarios. Search Query matches against the user’s search terms. You can use operators like contains, equals, starts with, or ends with to match specific query patterns. Collection Handle targets searches within specific collections. This is particularly useful for applying different search behaviors to different product categories. Product Type and Product Vendor allow targeting based on the types of products or vendors in your catalog, enabling category-specific or brand-specific search modifications.

Action Types

Each Search Rule can have one or more actions that modify the search request:

Replace Query

Completely replaces the user’s search query with a different query. Use this when you want to redirect searches for specific terms to more relevant alternatives.

Modify Query

Adjusts the search query without fully replacing it. Modification options include appending text to the end of the query, prepending text to the beginning, or replacing specific words within the query with alternatives.

Add Filter Group

Injects additional filters into the search request. This allows you to automatically narrow results based on the targeting conditions without the user explicitly selecting filters.

Modify Tuning Parameters

Adjusts the search tuning parameters for matched requests. You can modify the textual weight (balance between keyword and semantic matching), visual weight (influence of image similarity), minimum match threshold, and multiple factor settings.

Override Sort Order

Forces a specific sort order for matched search requests, overriding the default or user-selected sorting.

Priority System

Search Rules use a priority system where lower numbers indicate higher priority. When multiple rules match a request, they are applied in priority order. This allows you to create layered rule sets where more specific rules take precedence over general ones.

Best Practices

When creating Search Rules, start with broad rules and refine based on search analytics. Use the priority system to layer general rules with specific overrides. Test rules thoroughly using the search evaluation tools before enabling them in production. Monitor search performance after enabling new rules to ensure they improve the customer experience. Consider using Search Rules for common scenarios like redirecting misspellings to correct terms, boosting seasonal or promotional content, applying category-specific tuning parameters, and filtering out irrelevant results for specific query patterns.

See also