Skip to content

TBv3: Expose context-aware advanced filters on Spotlight Search #2689

Description

@filiperochalopes

User story

As a Term Browser user, I want Spotlight Search to expose context-aware filters based on where I am browsing so that I can perform advanced searches directly from Spotlight without depending on the standard filter panel.

Related docs: https://docs.openconceptlab.org/en/latest/oclapi/apireference/custom_attributes.html#space-in-attribute-value-search-criteria

Use case

Spotlight Search already knows the current navigation context. When the user is browsing within a Source, Spotlight should use that Source context and its properties to offer relevant search filters.

These filters may expose more advanced DSL Search capabilities than those currently available through the regular filter panel, including existence checks and negative filters.

Requirements

  • Make Spotlight filters domain-driven and context-aware.
  • When Spotlight is opened within a Source:
    • Detect the current Source.
    • Read the relevant Source properties and available searchable fields.
    • Expose applicable filters directly in Spotlight.
  • Support advanced DSL Search operators where applicable.
  • Support existence and non-existence filtering.
  • Support negative filters, including syntax such as ! for not equal/exclusion where supported by the DSL.
  • Allow Spotlight to expose useful DSL filters even when those filters are not available in the standard filter panel.
  • Keep the current Spotlight search behavior available alongside the advanced filtering capabilities.

Acceptance criteria

  • Given a user inside a Source, when Spotlight is opened, then filters relevant to that Source are available.
  • Available filters are derived from the current browsing context rather than being a single static global list.
  • Users can perform supported existence, non-existence, and negative queries directly from Spotlight.
  • Spotlight can use supported DSL Search capabilities that are not exposed by the regular filter panel.
  • Existing Spotlight searches continue to work without requiring advanced filters.

More details (collapsible)

Context

This enhancement follows the new Spotlight Search Bar presented for Term Browser v3.

The proposed direction is for Spotlight to understand both the user's current location and the domain being searched.

For example, when the user is currently browsing a Source, Spotlight already has enough navigation context to identify that Source. It can use the Source properties and search capabilities to dynamically offer relevant filters.

The intention is not to limit Spotlight to the filters exposed by the existing filter panel. Spotlight can provide a more expressive entry point into DSL Search, including advanced operators such as existence checks and negative filtering.

Example capabilities:

field exists

field does not exist

field equals value

field does not equal value

exclude a particular value using supported DSL syntax such as !

The exact filter suggestions should depend on the current domain and context.

TBD

  • Define which Source properties should be exposed as Spotlight filters.
  • Define the Spotlight syntax and UI for advanced operators.
  • Define how available DSL filters and operators are discovered for each context.
  • Determine whether Spotlight should suggest filters progressively as the user types.

Metadata

Metadata

Labels

signal/low-riskSafe to execute with minimal downsidestage/triagedAI triage complete — scored and classifiedtype/featureNew or improved functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions