Skip to content

[TASK] SiteSearchAPI/SiteSearchWebAPI — vendor-neutral aggregation abstraction #35786

@fabrizzio-dotCMS

Description

@fabrizzio-dotCMS

Description

SiteSearchAPI (public interface) returns org.elasticsearch.search.aggregations.Aggregation and throws org.elasticsearch.ElasticsearchException. SiteSearchWebAPI (Velocity ViewTool) casts directly to concrete ES aggregation implementation classes (InternalDateHistogram, StringTerms, StringTerms.Bucket). This blocks Site Search from being served by OpenSearch in Phase 3.

Priority: Blocking Phase 3 — Site Search
Dependency: OSSiteSearchAPI implementation (#34609)

Scope

  1. Define vendor-neutral DTO IndexAggregation (and sub-types for date histogram / terms) under com.dotcms.content.index.domain
  2. Update SiteSearchAPI — replace Aggregation return type with IndexAggregation; replace ElasticsearchException throws with DotSearchException
  3. Update SiteSearchWebAPI — remove casts to InternalDateHistogram, StringTerms, Bucket; use IndexAggregation API
  4. Update ESSiteSearchAPI — adapt ES aggregation results to IndexAggregation DTO (adapter pattern)
  5. OSSiteSearchAPI (from [TASK] Migrate Search Layer #34609) — implement using OS aggregation types, return same IndexAggregation DTO

Checklist

  • Define IndexAggregation DTO and sub-types in com.dotcms.content.index.domain
  • Remove Aggregation, ElasticsearchException from SiteSearchAPI public signatures
  • Remove InternalDateHistogram, StringTerms, Bucket casts from SiteSearchWebAPI
  • Adapt ESSiteSearchAPI to produce IndexAggregation from ES results
  • OSSiteSearchAPI returns IndexAggregation from OS results

Acceptance Criteria

  • Zero org.elasticsearch.* imports in SiteSearchAPI and SiteSearchWebAPI
  • Velocity templates using $SiteSearch receive the same aggregation data structure
  • Both ES and OS providers are swappable without changing SiteSearchWebAPI
  • Existing site search integration tests pass

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions