Query rewriting rules with Querqy for OpenSearch

Querqy adds merchandising-style rules to OpenSearch search so teams can boost, bury, filter and redirect results. Check its supported OpenSearch version range before you plan the install.

On this page

When Querqy rules belong in OpenSearch search

A product or content team often wants to push a result up, hide it, or send a query somewhere else for a specific search term, and wants that change live without waiting for a code release. Query rewriting rules are the usual answer. Querqy is a community query rewriting plugin for OpenSearch that applies rules for boosting, burying, filtering and redirecting results. Those four actions cover most merchandising-style requests, such as promoting a seasonal product for a term, pushing out-of-stock items down the list, or sending a brand query to a landing page. Rules like these belong in search when the logic is about relevance and business emphasis rather than about how the index or analyzers work, which is a different problem covered on other pages in this group.

The version limit is the first decision to make. The Querqy documentation states that the plugin supports OpenSearch versions up to 2.19.2. If your cluster runs a newer OpenSearch release, the plugin may not be compatible with it, so confirm the current compatibility with the plugin's own documentation before you commit to it. OpenSearch's release line moves on a regular cadence, and a plugin's support window can fall behind it. Ask whether the rule-management approach you want depends on a version you can no longer upgrade to, and plan the cluster version and the plugin together rather than separately.

Querqy is a community plugin. It is not a feature of the OpenSearch project, and it is not a DeployOpen product or a DeployOpen-supported component. Your team carries the decision to adopt it, so review its maintenance status, license terms and release history yourself before it reaches production. Before you install it, check whether a rule set can be reviewed, versioned and rolled back by people who are not search engineers, since merchandising rules change often and a bad rule can hide the wrong products in production. If those controls do not fit your change process, a simpler approach such as stored query-time filters may serve you better.

What each Querqy rule type does to results

Querqy rules change either the order of results or the set of results returned for a matching query. The four behaviors below differ in which of those they touch, so each one needs its own check before it reaches production traffic.

Boosting raises matching documents

A boost rule adds weight to documents that match a condition, so they rank higher without being removed from the list. Illustrative example: a merchandiser boosts in-house brand products for the query running shoes so they appear near the top. The risk on broad queries is that a boost tuned for one term pushes unrelated items above strong matches for queries that share that term, so test the rule against a sample of head and tail queries.

Burying lowers matching documents

A bury rule reduces the score of matching documents so they sink in the ranking while staying searchable. Illustrative example: discontinued or out-of-season items are buried for the query winter jacket so current stock leads the results. Because buried items still appear on later pages, check that a shopper searching for a specific product name can still reach it, and that buries do not hide the only relevant result for a narrow query.

Filtering limits the result set

A filter rule restricts results to documents that meet a condition, which changes which documents can be returned at all. Illustrative example: the query phone case is filtered to items compatible with a specified device category. Filters are the most likely rule type to produce empty result pages, and a broad query that matches a filter term too loosely can exclude relevant items, so confirm the filter field is populated and consistent in your index.

Redirecting replaces the query

A redirect rule rewrites the incoming query to a different query string before the search runs, which changes both the matches and the ranking. Illustrative example: a shopper searching tissues is redirected to facial tissue for a catalog that uses that term. Redirects are the hardest to reason about on broad queries because one rewrite can chain with other rules, so review the rewritten query for every rule you add and confirm how your rule set orders its execution.

Querqy configuration options and when each fits

This table compares the main configuration choices for Querqy rules: where rules live, how far they reach in a query, and how boost strength is set against the base relevance model. Read each row against your team's skills and change rate. The main takeaway is that the choice of rule storage and scope shapes who can safely change search behavior, so settle it before the first rule set goes live.

DecisionOptionTrade-offWhen it fits
Rule storageRules maintained in files under version controlChanges are reviewed and reproducible, but each edit needs a deploy and file accessDeveloper-led teams that want rules reviewed like code
Rule storageRules managed through the plugin's configuration interfaceFaster edits for non-developers, but needs an audit trail and access control around itCatalog teams that edit rules often and have a named approver
Rule scopeRules applied per query termPrecise control over individual terms, but rule counts grow quickly with the catalogNarrow merchandising cases such as a known brand or product line
Rule scopeRules applied per index or search templateFewer rules to maintain and consistent behavior across queries, but broader side effectsTeams that standardize one search template for a whole storefront
Boost strengthSmall boosts tuned against the base relevance modelPreserves default ranking, but effect can be hard to see without judgmentsCatalog teams adjusting a few promoted items
Boost strengthLarge boosts or burying rules that override base rankingStrong, visible effect, but can hide relevant results and hurt other queriesOnly with a documented business reason and a test before release
VerificationComparison of results before and after each rule changeAdds review effort for each edit, but catches unintended ranking shiftsAny team, and essential when rules are edited by non-developers

How to install Querqy on a self-hosted OpenSearch cluster

This sequence takes a self-hosted OpenSearch cluster from a version check through a tested Querqy installation and an initial rule set. The result is a plugin that loads on every node and rewrites known queries as the rules intend.

  1. Confirm the cluster version is supported

    Check the exact OpenSearch version of every node in the cluster, not only the version in your deployment template. Querqy is a community plugin that supports OpenSearch versions up to 2.19.2, so a cluster on a later version is outside that limit and should not receive the plugin without a separate compatibility check. Record the version and the plugin release you plan to use in the change record. The step is done when the version is written down, confirmed against the Querqy documentation, and approved by the owner of the search cluster.

  2. Rehearse the install in a matching test cluster

    Build a non-production cluster with the same OpenSearch version, node count, plugin set and security configuration as production, then install Querqy there first. Confirm that the Security plugin settings, index mappings and analyzers used by your search queries match production, because rewrite behavior depends on them. Ask the community maintainers or your platform team which Querqy build pairs with your exact version if the documentation is unclear. The step is done when the install and a restart complete cleanly on the test cluster and the results match what you expect.

  3. Install the plugin through your deployment method

    Install Querqy using the plugin mechanism your deployment uses, such as the OpenSearch plugin installer in a tarball or package install, or a plugin step in your container image or Helm values for Kubernetes. Build the image or configuration change through your normal review process so every node receives the same plugin version. Rolling restarts should follow the cluster's usual procedure with the cluster health checked between nodes. The step is done when the plugin is listed as installed on every node.

  4. Verify the plugin loads on every node

    Confirm the plugin is present on each node after the restart, not just on the node you used to run the install command. Check the plugin listing on every node and review the startup logs for errors related to Querqy. Then confirm the cluster returns to a green or expected health state. A node that starts without the plugin will fail to apply rules for queries routed to it, so this check must cover all nodes. The step is done when every node reports the plugin and no load errors appear in the logs.

  5. Define an initial rule set

    Write a small first rule set with a few rules for one boost, one bury, one filter and one redirect, using the search terms your team knows well. Keep the set narrow so any unexpected effect is easy to trace back to a single rule. Store the rule definitions in version control and review them with the people who own search relevance, since rules change which results customers see. Apply the rules to the test cluster first. The step is done when the rules load without errors and each rule is listed with its intended term.

  6. Check rewrites with query explain output

    Run known queries against the test cluster and use the explain output to confirm that each rule fires and produces the intended rewrite. Include at least one query that should not match any rule, so you can confirm that unrelated searches are unchanged. Compare the rewritten query and the top results with the expected outcome written in step five. The step is done when each known query returns the expected rewrite and the unrelated control query shows no change. Any mismatch goes back to the rule set before production.

  7. Promote the rules to production with a rollback plan

    Apply the same plugin version and tested rule set to production using the change process from earlier steps, and keep the previous rule configuration available so it can be restored quickly. Repeat the known-query checks against production and watch search results and error rates during the first period of live traffic. Ask your team to confirm the rollback steps before the change window. The step is done when production known queries return the expected rewrites and no new errors appear in the cluster logs.

Why the 2.19.2 version ceiling decides your upgrade plan

Querqy's documented support stops at OpenSearch 2.19.2, so a cluster running a newer minor or major version needs a compatibility check before you install the plugin or move the cluster forward. The ceiling is a documented limit, not a guess about what will break, but it changes the order of work. If the rules are part of your search experience, the plugin's compatibility becomes a gating item in the upgrade plan rather than a task to close afterward.

The trade-off is between staying on a version that is still supported and taking newer releases. OpenSearch versions stay under maintenance until a newer major version enters maintenance or one year passes, whichever is longer, and maintenance releases bring bug fixes and security patches but no new features. Check the OpenSearch releases page for the current maintenance status of your version before deciding. A cluster held at 2.19.2 may keep receiving patches while Querqy stays supported, but it will also miss newer features. Where the security or feature needs of your search team point to a newer release, the plugin's version support becomes the constraint to resolve first.

Before any upgrade, confirm with the Querqy maintainers which OpenSearch versions the plugin build you intend to use supports, and get that answer in writing for your target version. Ask whether a newer plugin build is planned, whether any known issues affect the rule types you use, and what they recommend for a cluster that must move ahead of the documented ceiling. Then test the rule set against a staging cluster on the target version, comparing results for your boosting, burying, filtering and redirecting rules, so the decision rests on evidence from your own queries.

Security and operational risks of rule-based search

Querqy rules change what users see and can hide or promote results, so they carry access, review and recovery risks that ordinary configuration does not. The cards below cover who edits rules, how changes are tested and audited, how the community plugin is kept current, and how a bad rule is reversed.

Limit who can edit rules

Rules that bury products or redirect queries affect revenue and compliance-sensitive results, so editing access should be narrower than read access. Map the people who maintain rules to dedicated OpenSearch Security roles, and keep cluster-admin rights away from merchandisers. Confirm with your team which roles can write to the index or config that stores the rules, since that is the path that changes live results.

OpenSearch security docs

Review rules before they go live

Treat each rule change like a code change with a named reviewer, a stated purpose and an expiry date for temporary promotions. Keep rule files in version control so the diff shows exactly which query terms were boosted, buried, filtered or redirected. Ask your team whether a second approver is required for rules that filter out whole product or content categories.

Test rules under user roles

A rule that works for an administrator can still fail for a search user whose role applies document-level or field-level security. Run the same queries with representative user roles and confirm that filtered or boosted results match what each audience is allowed to see. Include restricted documents in the test set so that a redirect or filter cannot expose content to an unauthorized group.

Audit every rule change

Enable audit logging through the Security plugin so that changes to the index or endpoints holding rules are attributable to a user and a time. Retain those logs under the same policy as your other security records. Confirm that audit output captures the rule-writing path you use, because a rule change that bypasses the audited API leaves no trail.

Patch a community plugin

Querqy is a community plugin, so security fixes depend on its maintainers and on your own release tracking rather than a vendor support contract. Querqy supports OpenSearch versions up to 2.19.2, which means a cluster upgrade can leave the plugin unsupported. Check the compatibility table before any OpenSearch upgrade, and plan a test cluster to confirm the plugin loads and rules still evaluate.

Querqy docs

Roll back rule changes quickly

Keep the last known good rule set in version control and document how to redeploy it without a full cluster restart. Decide in advance who may trigger a rollback and what evidence triggers one, such as a drop in conversion or a complaint about missing results. Rehearse the rollback on a staging index so the team knows how long reverting takes before an incident forces the question.

Questions teams ask before adding Querqy rules

Does OpenSearch support the Querqy plugin?

Querqy is a community plugin for OpenSearch, so check its compatibility before you plan any rule work. The OpenSearch documentation for Querqy states that it supports OpenSearch versions up to 2.19.2. If your cluster runs a later version, the plugin falls outside that documented range, and you should not assume it will load or behave as described. OpenSearch's maintenance policy covers OpenSearch itself, not community plugins. Confirm the exact plugin build and its release notes against your cluster version, then ask the implementation partner to test that build on a cluster that matches production.

What drives the effort of a Querqy rules project?

Four factors drive most of the effort: the number of rules, the number of merchandisers who write and change them, the depth of testing, and the version check. Each rule needs a clear intent, a defined query match and a test query that shows the expected result. More merchandisers mean more review, naming conventions and change control. Deeper testing means a larger set of sample queries and side-by-side result checks before each release. The version check is a one-time step at the start, but it can grow if the cluster version falls outside the plugin's supported range. Ask any quote to list these four factors separately so you can see which ones move the price.

How long does a Querqy rules project take?

The duration depends on scope, and no single timeline fits every search application. A small set of boosting, burying or redirect rules on one index can move through a short cycle. A large catalog with several languages, many merchandisers and frequent changes takes longer because of the testing and review it needs. DeployOpen agrees scope, deliverables and timelines in writing before work starts, so ask the quote to show the milestones: rule inventory, installation on a test cluster, analyst review, performance check and handover. Also ask how a later version change or a larger rule set would move those dates.

Can our own team set up Querqy rules without a partner?

A team can do this alone if it has two skill sets. The first is OpenSearch administration: installing a plugin, managing the cluster and checking it after restarts or upgrades. The second is search analysis: knowing how queries are matched, how scores are built and how a rule changes ranking for real user terms. Many teams have one of these skills but not both. Rules that are added without testing can bury products users need or hide valid results. Decide who owns the cluster, who writes rules, who reviews them and who signs off on releases. If one of those roles is missing, a partner can cover it under a fixed scope while your team keeps ownership of the rules.

What does a Querqy rules project need from our team?

The work needs three inputs from your side:

  • A test cluster that runs the same OpenSearch version and plugin build as production, with a copy of the index or a representative sample.
  • A set of sample queries drawn from search logs, including head queries, long-tail queries and queries with known problems.
  • Search analysts or merchandisers who can state the business intent of each rule and review the results.

Without a test cluster, changes can only be checked in production. Without sample queries, the tests cannot show whether a rule helps or hurts real traffic. Without analysts, rules reflect technical guesses rather than merchandising goals. Ask the quote to list these inputs and the person responsible for each one.

What happens if our OpenSearch cluster must move to a newer version?

The plugin decides how far you can move the cluster. Because the documented Querqy support runs up to OpenSearch 2.19.2, a move to a later version requires a compatible Querqy build, or the rules must be paused until one is available. Check this before you schedule any upgrade. OpenSearch's own upgrade methods include rolling upgrades, snapshot and restore, remote reindexing and Migration Assistant, but the plugin must be tested with the target version as part of the plan. Build the rules as versioned configuration, keep a tested rollback, and run the sample query set on the new version before production cutover. Ask whether the plan includes a compatibility check and a rollback test.

Does Querqy add license costs to our OpenSearch stack?

OpenSearch is released under the Apache License, Version 2.0, and the OpenSearch FAQ does not describe a paid edition. Querqy's own license terms were not part of the material used for this page, so confirm them in the project before adoption. Most of the cost of a rules project comes from labor, not software: setting up test infrastructure, writing and reviewing rules, running tests and maintaining rules after each plugin or cluster upgrade. Those costs recur whenever rules change or the version moves. Ask any quote to separate one-time setup from ongoing rule maintenance and to name who pays for test infrastructure.

How a Querqy rule changes a search request

The search request starts in the application and reaches the OpenSearch search endpoint, where the Querqy plugin matches the incoming query against the rule set. Matched rules boost, bury, filter or redirect the query before OpenSearch runs it against the index and returns ranked results. The rule store and the admin edit path sit in a separate trust boundary, so teams should check who can change rules and how those changes are reviewed before they reach production traffic.

Querqy rewrites the query between the search endpoint and the index, using rules edited under separate admin controls.

Measuring whether a rule helps shoppers

Test every Querqy rule against a fixed query set before it reaches shoppers. A rule that boosts one product line, buries a discontinued item or redirects a brand term can change results for queries nobody had in mind. Build a sample query set that includes the queries the rule targets, the nearby queries that share terms with them, and a control group of unrelated queries that should not move. Record the top results for each query on the current configuration, apply the rule set in a staging index with the same data, and record them again. Compare the two lists side by hand for the first pass, paying attention to where filtered products disappear and where buried items still surface on broad queries. Keep the query set and the saved outputs under version control with the rule files, so the next change is checked against the same baseline rather than against memory.

This check shows what a rule does to the results list, but it cannot show whether shoppers prefer the new order. For that judgment, use the Search Relevance Workbench, which compares query configurations using query sets, judgments and side-by-side results, and User Behavior Insights for capturing the queries, results and clicks that show how people actually respond. Confirm with your search team which of these tools your OpenSearch version supports before you plan the evaluation, because the Querqy version limit of 2.19.2 applies to the plugin, not to the sibling topics. Ask your implementation partner to document the baseline query set, the reviewer for each rule change and the criteria for rolling a rule back, so that the decision to keep or remove a rule rests on recorded evidence instead of a single review.

How DeployOpen scopes and delivers Querqy work

DeployOpen plans, implements, tests and documents Querqy rewriting rules on a self-hosted OpenSearch cluster inside your own infrastructure. Each engagement starts from a written scope that names the rule types, the query paths they touch and the OpenSearch version in use, so merchandising rules can be reviewed and handed to your team with the plugin version fixed.

How we scope

  • Confirm your OpenSearch version against the Querqy compatibility limit before any rule work begins
  • List which boosting, burying, filtering and redirecting rules the business needs and who owns each one
  • Record the query paths, index names and environments the rules will run against in the written scope
  • Agree fixed deliverables, acceptance tests and timelines in writing before work starts

How we build

  • Install the Querqy plugin on the cluster version you have confirmed, using your chosen deployment method
  • Model rules in a reviewable format and keep them under version control with change history
  • Test each rule against sample queries to confirm the intended ranking, filtering or redirect behavior
  • Check that rules do not alter unrelated queries, security settings or index mappings

How we hand over

  • Document the installed plugin version, rule syntax, rule ownership and the review steps for changes
  • Provide a test query set your merchandisers and engineers can rerun after every rule change
  • Walk your team through the rollback procedure for rule sets and plugin upgrades
  • Deliver the scope, configuration and test records in a form your reviewers can audit

How we support

  • Ongoing support, plugin upgrades and continuous testing are available as retainers
  • Plan any OpenSearch upgrade around the Querqy version limit, since support ends at the supported version
  • Retest rule sets after each OpenSearch minor or major upgrade before they go back into production
  • Ask any provider to confirm plugin compatibility against your exact OpenSearch release before quoting

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.