Capturing search behavior with OpenSearch User Behavior Insights

User Behavior Insights links each search query, the results shown and the user actions taken on them, giving relevance teams the data to tune ranking. This page covers what to capture, how to collect it and what to plan before turning it on.

On this page

Why capturing search behavior with OpenSearch User Behavior Insights comes before relevance tuning

A team running site or application search on self-hosted OpenSearch often cannot say which queries return nothing useful or which results actually win clicks. Without that evidence, relevance changes are guesses made against a handful of manual tests. User Behavior Insights (UBI), introduced in OpenSearch 2.15, is a schema that links each query to the results shown and to the user actions taken on them, with client applications sending those events to a UBI endpoint. Teams need it when they want tuning decisions to rest on recorded behavior: zero-result queries, low click-through on top positions, and queries that users reformulate. Confirm the exact UBI components available in your OpenSearch version before you plan the work, because the plugin and its endpoint are part of your cluster build.

UBI does not improve relevance by itself. It records events and stores them in indices that you then query and analyze, typically in OpenSearch Dashboards. It does not decide what a good result is, it does not rewrite queries, and it does not measure whether a change helped. Those steps belong to analysis, synonym or ranking work, and to testing changes before release. Plan the event pipeline first, because the data it produces is only as useful as the identifiers, timestamps and result positions your application sends. Ask whether your front end can attach a query ID to every search and a consistent user or session identifier to every click, and whether your privacy review has approved storing those identifiers.

Decide early where capture happens. Client-side collectors record clicks and other user actions in the browser or app, while server-side query capture records the query and the results returned to the user. Each side needs its own review: client code runs on every user device, and server logging touches the search cluster that holds your data. Confirm which events your application can produce reliably, how long the event indices will be retained, and which roles can read them, since search logs often reveal the terms people type. Setting these answers before the first event is sent avoids rebuilding the pipeline later.

Client-side collectors or server-side query capture: which to choose

Single-page applications render search results in the browser and see what the user does next: which result they open, how long they dwell, and whether they refine the query. A client-side collector is the natural fit because the browser already knows the user action and the results on screen. Developers add a small script or wrapper around the search component that sends events to the UBI endpoint when a result is clicked or a filter is applied.

  • What it captures well: clicks, hovers, scroll depth and interactions with rendered results, including results that were only visible in the viewport.
  • What it misses: clicks on pages outside the search widget, such as product pages reached from a bookmark, and search calls that never reach the browser.
  • What it needs from developers: instrumentation in every component that renders results, a stable query identifier passed through navigation, and handling for users who block scripts.
  • Result rendering failures: if a result fails to render, the browser may still log the impression, so confirm that impressions are only sent after a successful render.

Confirm with your front-end team how routing and state management pass the query ID between views before you commit to this approach.

Configuration options and when each fits

This table compares the main decisions a team makes before collecting search behavior with User Behavior Insights, including event types, capture location, identifiers and retention. Read each row for the condition that favors an option and the cost it carries. The main takeaway is that identifier design and capture location are hard to change once events are flowing, so settle them before the first collector ships.

DecisionWhen it fitsTrade-off to weigh
Event types capturedQueries and clicks only when the goal is click-through analysis. Add result impressions and conversions when you need to judge ranking, not just clicks.Each added event type increases volume, client work and the privacy review scope. Confirm the event schema in the UBI docs before deciding.
Client collectorFront-end search with a browser or app that can report what a user saw and clicked, including the position of each result.The client sends what it knows, so missed events, ad blockers and app version drift create gaps. Test coverage on each release.
Server-side query captureSearch runs through your own API or backend, so queries are logged where they are executed and can be paired with results shown.Clicks still come from the client, so server capture alone does not record user actions. Plan a second path for clicks.
Query and result identifier designStable query IDs and result IDs that tie a shown result to a later click, so analysis can rank documents by outcome.Identifiers that change between searches or pages break joins. Changing the scheme later leaves historical data hard to compare.
User and session identifiersSession IDs for short-term behavior such as reformulations. User IDs for returning-visitor patterns, only where the purpose is documented.Persistent user IDs raise personal data questions in most jurisdictions. Ask your privacy team to confirm the lawful basis and retention before collection starts.
Retention and index placementShort retention with aggregated outputs when the goal is relevance tuning. Longer retention only when the business case and access controls are written down.Longer retention increases storage and access review work. Place UBI indices under the same role and field controls as other sensitive search data.
Sampling and volumeFull capture for low-traffic sites or pilots. Sampling when event volume strains the cluster or the collector pipeline.Sampling reduces noise in rare queries, which are often the ones that matter most for relevance. Confirm the impact with a pilot before enabling it.

How to set up UBI on a self-hosted OpenSearch cluster

This sequence takes a self-hosted cluster from a version check to a verified capture pipeline, so that queries, results and user actions can be joined by identifier for relevance analysis.

  1. Confirm the cluster version supports UBI

    Check that the cluster runs OpenSearch 2.15 or later, the release in which User Behavior Insights was introduced. Your platform team confirms this from the cluster version reported by the API root endpoint and the Dashboards version in the same environment, and notes any older clusters that need an upgrade before capture begins. Upgrade planning belongs in a separate change window. Done when the version is recorded in the project's configuration notes and every target cluster is on 2.15 or later.

  2. Enable the UBI plugin and endpoint

    Install or enable the User Behavior Insights plugin on the cluster, following the install guidance for your deployment method (Docker, Helm, the Kubernetes Operator, packages or tarball). Confirm the UBI indices and the endpoint that client applications will call are created and reachable from the application network only. Restrict who can write to these indices with the Security plugin so event data is not writable by general users. Done when a test request to the endpoint from an approved application host returns a success response and the access restrictions are confirmed by a second person.

  3. Define the event schema with the application team

    Agree with the application owners which events are recorded: the query text and its identifier, the result list shown to the user with each document's position, and the actions taken, such as clicks, add-to-cart or conversions. Decide how the identifiers are generated and passed between the query, the results and the action, and which user or session identifier is used and how it is pseudonymized. Record the decisions in a short schema document kept with the code. Done when the application team signs off the field list and the identifier rules in writing.

  4. Instrument the search front end or back end

    Add the collector to the layer that owns the data. A browser collector captures clicks and dwell actions on the rendered page, while a server-side collector records the query and the result list at the point the search response is returned, which is usually more reliable for impressions. Make sure the query identifier is generated once per search and carried to every later action. Done when a manual search and a click on the result page each produce an event in the application's debug output, with matching identifiers.

  5. Send test events from staging

    Run a scripted set of searches in a non-production environment, including repeated queries, empty result sets, paginated results and clicks on different positions. Send the events through the UBI endpoint and confirm each request is accepted and no event is dropped by the application or the proxy in between. Check that the payload sizes and request rates are within what the endpoint and the network path allow. Done when the test run produces the expected count of query and action events with no rejected requests in the logs.

  6. Verify the records link by identifier in Dashboards

    Open the query and event data in OpenSearch Dashboards and check that each action record joins to the query and result records through the shared identifier. Confirm that a click on position three appears against the same query identifier that produced the result list, and that no action appears without a matching query. Look for duplicates caused by retries and for timestamps that are out of order. Done when a sample of at least several test sessions joins cleanly and the team has written down the join query for later use.

  7. Enable production capture and review access

    Turn on capture in production with the same configuration validated in staging, and set index retention and access rules according to your data handling policy, since event data may contain user identifiers or search text. Confirm that role-based access limits who can read the raw events, and schedule a periodic check that joins still succeed after application releases. Done when production events are arriving, the join check passes on live data, and the access rules are recorded in your configuration management system.

Analyzing captured behavior in OpenSearch Dashboards

The point of analysis is to turn captured UBI events into a short list of queries that need a fix. Start with three views in OpenSearch Dashboards: zero-result queries, where the query returned nothing, low click-through queries, where results were shown but few were clicked, and skipped results, where a higher-ranked document was displayed and passed over in favor of a lower one. Each view points to a different remedy, so keep them separate rather than merging them into one relevance score. The stored UBI data depends on the query and event indices you configured in the collector and the server-side capture, so confirm with your team which index patterns the Dashboards views read from before anyone builds a report on them.

Before trusting any of these views, check the data itself. Confirm that the query_id links a query event to its later click or other action events, that timestamps are in one time zone, and that filters or bot traffic are removed or tagged. Ask who owns the index pattern, who can read the raw query text, and how long events are kept, because search logs often contain user-entered text that falls under your privacy and retention rules. Also decide how many days of data a review needs, and whether internal test searches are excluded. Dashboards makes it easy to build a chart on incomplete events, so treat the first few reviews as a check on the pipeline as much as on search quality.

Turn findings into a feedback loop with explicit owners. Zero-result queries with clear vocabulary gaps usually go to the synonym list, and the change should be reviewed as an analyzer change. Low click-through and skipped results usually go to query tuning, such as field boosts or match settings, and each change should be recorded with the query set it targeted. Those changes then move into relevance testing, where you compare the old and new configurations on the same queries before shipping. Do not promise that a given change will lift click-through; the data shows where users struggle, and only a controlled comparison shows whether a change helped. Agree in advance on the review cadence and on who approves a change.

Privacy, access and data handling for captured search data

Captured search behavior links what users typed to what they saw and clicked, so the UBI indices can hold personal or sensitive content. The cards below cover what that data contains, who can read it, how it is encrypted in transit, how long it is kept, and what the organization must decide with its legal team before collection starts.

Queries can hold personal data

Users often type names, account numbers, medical terms, email addresses or internal project names into a search box, and UBI stores those strings alongside query IDs and user IDs. Review a sample of real queries from a test environment before enabling collection, and decide which fields the client-side collector will send. Treat the query text as sensitive by default, even when it appears harmless to developers.

Role-based access to UBI indices

Use the OpenSearch Security plugin to give analysts and relevance engineers read access to the UBI indices, and keep write access limited to the ingestion path. Separate roles for collection, analysis and administration make it possible to show an auditor who can read captured behavior. Confirm that Dashboards visualizations built on these indices inherit the same role restrictions.

Security plugin docs

Document and field-level security

Document-level security can restrict which events a role sees, for example limiting a team to queries from one application or index. Field-level security and field masking can hide the user identifier or query text from roles that only need click-through rates. Test each role against sample documents, because a field left unmasked in one index alias can expose the same data elsewhere.

TLS on the UBI endpoint

Client applications send events to a UBI endpoint, so the path from browser or backend to the cluster needs encryption. Enable TLS for client traffic as well as node-to-node traffic, and confirm that certificates are rotated and that collectors validate the server certificate. Check the proxy or gateway in front of the endpoint for logging of request bodies, since many gateways record payloads by default.

Retention limits for behavior data

Captured behavior grows with traffic and stays useful for relevance tuning only for a bounded period. Set a retention policy in the index lifecycle configuration and document the reason for each period, then delete or snapshot-and-expire old indices on schedule. Include UBI indices in snapshot repositories, so that backups do not keep data the retention policy has removed. Ask the organization to confirm the retention period in writing.

Consent and disclosure decisions

Whether search behavior may be recorded, and for what purpose, depends on the jurisdiction, the product's privacy notice and the sector. Ask the organization's legal and privacy teams to confirm the lawful basis, the disclosure wording, opt-out handling and any rules on sharing captured data with other teams or vendors. DeployOpen can build the controls, but the policy decisions belong to the client.

Questions teams ask before capturing search behavior

What drives the cost of capturing search behavior with UBI?

The cost comes from four places: instrumenting the front end, capturing queries and results on the server, storing the events, and analyst time spent turning them into relevance decisions. Instrumentation is usually the largest one-time item because every search box, results list and click target must send events in the agreed schema. Storage and cluster capacity recur and grow with traffic, search volume and how long you keep events. Analyst time recurs for as long as you review queries and clicks. When you ask for a quote, request separate line items for each of these, plus the environments you will test in, so you can see which parts scale with your traffic.

How long does UBI setup take for a typical site?

Duration depends mainly on how many front ends send events and how much each one already tracks. A single search page built on a framework with a clear event layer is far quicker to instrument than several applications, mobile clients and a custom single-page search widget, each with its own state handling. Expect the schema design and event review to happen before any client code changes, and expect testing to cover both query capture and click attribution. DeployOpen agrees timelines in the written scope before work starts, so ask for a phased plan that lists the front ends, the event types and the review points.

What does the team need to provide for the work?

You need access to the search front ends and the code that renders results, a named owner for the search experience, and someone who can approve the event schema. The OpenSearch cluster must already run or be planned, with the OpenSearch Dashboards instance available for analysis. Your privacy or security reviewer should see what user identifiers and query text are captured before go-live, because queries can contain personal data. Keep a staging environment that receives realistic traffic patterns so the team can verify events without polluting production analysis.

Can our own team capture search behavior without a partner?

Yes, a team with front-end and OpenSearch experience can build it in-house, and the UBI documentation describes the schema and how client applications send events to a UBI endpoint. The harder parts are consistent event design across applications, server-side query capture, and keeping the analysis routine running after launch. Make the decision by counting the people who can own each piece over the next year. If that capacity is thin, a fixed-scope engagement can cover design and build, with the handover documented so your team runs it afterward.

Does UBI replace Learning to Rank or the Search Relevance Workbench?

No, UBI supplies the data they depend on rather than replacing them. UBI records which queries ran, which results were shown and which actions users took, which gives you judgment-like signals. Learning to Rank uses feature and click data to train reranking models, so it needs that history first. The Search Relevance Workbench compares query configurations against judgments and experiments, and captured behavior can inform the judgment sets. Plan the event schema with those later uses in mind, because changing event fields after months of collection breaks comparisons.

What breaks most often after UBI goes live?

The most common problems are missing or duplicated click events, query text that does not match the results shown because of asynchronous rendering, and client changes that silently alter the schema after a release. Bots and internal test traffic can also distort click-through patterns. Check event volume against search volume in dashboards, sample a few sessions end to end, and add a schema validation step to release checks. Confirm the exact fields and endpoint behavior against the current UBI documentation for the OpenSearch version you run.

How much storage and analyst time should we plan for?

Storage grows with the number of searches, the results returned per search and the events per interaction, and it recurs as long as you retain the data. Ask the team to estimate events per search from a sample of real traffic before sizing the cluster, and set a retention period that matches how far back your relevance work needs to look. Analyst time depends on how often you review queries, judge results and act on findings. Ask for the review cadence in the scope, because a monthly review and a weekly one carry very different recurring costs.

Do we need to check privacy or compliance before collecting queries?

Usually yes. Search queries can reveal personal, health, financial or confidential information typed into a search box, and captured user identifiers can make that data personal. Decide what is captured, how identifiers are pseudonymized, how long events are kept and who can query them in OpenSearch Dashboards. Pair the role design with OpenSearch Security controls such as role-based access and field-level security so analysts see only what they need. Your privacy office should confirm the approach against the rules that apply to your organization.

How DeployOpen scopes and delivers search behavior capture

DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, so search behavior capture runs on OpenSearch you control. We agree the scope, build the UBI collection path, and hand over a working setup your team can operate and extend.

How we scope

  • We agree in writing which applications, search pages and events will send User Behavior Insights data.
  • The scope names the UBI schema version, the client collectors, the server-side query capture and the Dashboards views.
  • Engagements are fixed-scope, with deliverables and timelines confirmed before any work starts.

How we build

  • We deploy the UBI endpoint and event flow on your OpenSearch cluster, within the access model you approve.
  • We implement client-side collectors that record queries, displayed results and user actions in the agreed format.
  • We test that events arrive complete, correctly linked and free of personal data you have excluded from collection.

How we hand over

  • You receive configuration, collector code and runbooks documenting how each event type is produced and stored.
  • We document the retention settings, index layout and Dashboards analyses so your analysts can read the data.
  • We walk your engineering and search teams through the setup and the steps for adding a new search surface.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
  • A retainer can cover checks after OpenSearch version upgrades, which follow the project's maintenance policy.
  • Ask any partner for a quote built from a written scope that lists the components, environments and owners.

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.