Repository navigation
Conversation
Use the existing data-asset query path and page search configuration for Knowledge Center pages. This retains literal matches for question titles while preserving Lucene syntax on both search backends.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Use one compile-time constant in both routing switches to follow the Java contribution guide and keep their index names aligned.
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsRouting page searches through the data-asset builder changes searchable fields and facets, so pages matching only excluded fields may no longer appear. Routes ✅ 1 closed✅ Bug: Parameterized IT runs create the same page name, so the second gets a 409
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Hi @sonika-shah, could you add #38006 to the Shipping project, fill in the required Status, Source, Priority, Domain, and Release fields, and rerun the Validate PR Metadata check? Could you also review this PR when you have a chance? It fixes the Knowledge Center page search regression on both Elasticsearch and OpenSearch. The PR description includes the regression test results. Thank you! |
Describe your changes:
Fixes #38006
A Knowledge Center page titled
What are the vacation options?can be found by the default data-asset search but return no hits when the search is scoped topage. Page indices fall through to the aggregate builder, whose complex-query path lacks the analyzed literal-match branch used by data-asset searches.Add
pageandknowledge_page_search_indexto the existing data-asset classifier and map both to the existing page search configuration. Define the page index string once as a private constant shared by both switches. These helper changes fix the routing for Elasticsearch and OpenSearch. Query text, Lucene syntax, MCP parameters, authorization, schemas and index mappings are unchanged.Type of change:
High-level design:
N/A — small fix to existing switch cases. No new setting, migration or reindex is required.
Page-scoped free text and aggregation matching now use the existing configured page fields (
name,displayName,description,fullyQualifiedName,fqnPartsand their configured variants), and page search uses itspageTypeaggregation. This replaces the aggregate path's all-fields matching and aggregate facets, so matches confined to other fields and facet output can change.Tests:
Use cases covered
?finds the expected page, as does the same question without the trailing question mark.name:<topic>*query still finds that page.Unit tests
Updated
SearchUtilsTestandSearchSourceBuilderFactoryTest.spotless:applyandspotless:checkpass.d47e27f2:SearchUtilsline coverage is 288/369 (78.05%) for the selected run;isDataAssetIndexhas 100% line coverage and the added page mapping is covered. Full-suite coverage was not measured.Backend integration tests
Updated
KnowledgePageHierarchyITwithtestPageSearchMatchesQuestionAndPreservesLuceneSyntax, parameterized overpageandknowledge_page_search_indexwith distinct page names.Manual local validation against isolated Testcontainers stacks, on the behavioural fix at
d47e27f2:KnowledgePageHierarchyITresultpostgres-opensearch(PostgreSQL 15 / OpenSearch 3.4.0)mysql-elasticsearch(MySQL 8.3.0 / Elasticsearch 9.3.0)On unpatched main, the HTTP regression for the
pagealias returns an empty hit list for the question ending in?; the fixed run finds the expected page. Both alias invocations pass after the fix.The subsequent constant extraction only replaces the two identical string literals with one private compile-time constant. Expanding it reproduces the tested source exactly; the 574 unit tests and Spotless were rerun after that extraction.
The impact planner's branch ownership check passes. The full impacted integration/nightly plan and full service unit suite remain not run; these focused results establish PR review readiness, not merge readiness.
The upstream metadata check still needs maintainer triage: issue #38006 must be added to the Shipping project with its required Status, Source, Priority, Domain and Release fields. The current contributor authentication has no project scope, so that project setup has not been performed here.
Integration validation commands
Run sequentially for each profile above:
The second run replaces
-Ppostgres-opensearchwith-Pmysql-elasticsearch. Generated models, scripts and Swagger outputs were reused from the preceding full reactor build; formatting was checked separately.Ingestion integration tests
N/A — no ingestion changes.
Playwright (UI) tests
N/A — no UI changes.
Visual regression baselines
N/A — no rendering changes.
Manual testing performed
No separate manual UI test. The automated HTTP regression creates synthetic articles and verifies the returned page identity against each real search backend.
UI screen recording:
N/A — backend-only bug fix.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.Self-reviewed
32a204c3, including callers of both shared helpers and both backend implementations; no unresolved important findings. This follows related fixes #33655 and #35440. The switch additions need no explanatory code comment. No new contract, setting or decision record is introduced; schema, migration and UI requirements are not applicable for the reasons above.

Confidence Score: 5/5
The reviewed changes appear safe to merge; no blocking issues were found.Summary
Page searches now use the existing data-asset query builders and page settings on Elasticsearch and OpenSearch. The latest commit shares the page index name through one private constant without changing behavior.
Tests were not rerun during this review.
Reviews (2) · Last reviewed commit: "refactor: share the page search index na..." · Reviewed by Greptile