dotCMS / dotCMS/core

OpenSearch phase-2 gaps: neutral aggregations (histogram/date_histogram) + site-search highlights

Open
#36,576 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team : Scout
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Found during the phase-2 (dual-write, reads from OpenSearch) integration triage — see #36501. These are larger OS feature gaps, deferred from the phase-2 product-fix batch and related to the deferred OSSiteSearchAPI work (#34609 / follow-on to #35786).

1. OS neutral aggregations: histogram / date_histogram not mapped

Aggregation.fromSingleOS (dotCMS/src/main/java/com/dotcms/content/index/domain/Aggregation.java ~137-180) handles only terms/top_hits and returns null for everything else; fromOS drops nulls. Histogram and date_histogram are never produced. AggregationBucket (.../domain/AggregationBucket.java) has OS factories only for terms buckets — no histogram/date-histogram bucket overload. The ES path handles them (Aggregation.java ~101-106 → AggregationBucket.fromHistogram).

Fails (phase 2): SiteSearchWebAPITest.getAggregations_dateHistogram_keyAsEpochMillis, getAggregations_numericHistogram_keyAsNumber, getFacets_dateHistogram_exposesEpochMillisTime, getFacets_histogramAggregation_wrapsAsCountHistogramFacet.

Fix direction: add isHistogram()/isDateHistogram() branches to fromSingleOS + AggregationBucket.fromOS(HistogramBucket)/(DateHistogramBucket) normalizing the key to epoch-millis/numeric. Shared neutral DTO → also benefits OSSearchAPIImpl.

2. OS site-search highlights hardcoded empty

OSSiteSearchAPI.search() (dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/sitesearch/OSSiteSearchAPI.java ~283-286) sets ssr.setHighLight(new String[0]) with a TODO: the neutral SearchHit DTO does not carry per-field highlights yet. Fails (phase 2): ContentletIndexAPIImplTest.testSearch (the highlight-assertion half).

Related: #34609, #35786, #36501.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Aggregation.java and AggregationBucket.java, then run the four named aggregation tests to trace the neutral OpenSearch mapping gaps. Read OSSiteSearchAPI.search() and ContentletIndexAPIImplTest.testSearch for the highlight path. Done means histogram/date_histogram results and site-search highlights are represented by the neutral APIs and the named tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.