Skip to content

Revert "Fix #4213 Advance Search Filter" - #4789

Merged
harshach merged 1 commit into
mainfrom
revert-4644-advance-search
May 9, 2022
Merged

harshach merged 1 commit into
mainfrom
revert-4644-advance-search

Conversation

@vivekratnavel

Copy link
Copy Markdown
Contributor

Reverts #4644

@vivekratnavel
vivekratnavel requested review from a team and harshach May 9, 2022 04:08
@sonarqubecloud

sonarqubecloud Bot commented May 9, 2022

Copy link
Copy Markdown

[open-metadata-ui] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

3.4% 3.4% Coverage
6.1% 6.1% Duplication

@sonarqubecloud

sonarqubecloud Bot commented May 9, 2022

Copy link
Copy Markdown

[catalog] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@harshach
harshach merged commit b852d2e into main May 9, 2022
@harshach
harshach deleted the revert-4644-advance-search branch May 9, 2022 06:58
harshach added a commit that referenced this pull request Jul 1, 2026
…d_context PBAC

- Reindex now populates the dedicated chunk index (issue #4789 backfill):
  the bulk sink writes all chunk docs when re-embedding, and backfills
  missing chunks (fingerprint-guarded, no-op once present) for entities
  whose cached embedding was reused — so one full reindex migrates an
  existing catalog to multi-chunk semantics.
- Combined updateEntityEmbeddings embeds each chunk once and reuses
  chunk 0 for the legacy entity-doc partial update (N embedding calls
  instead of N+1); wired into the lifecycle handler, the reembed CLI,
  and the reindex sink. legacyEmbeddingFields extracts only the
  embedding payload so chunk filter fields can never clobber entity-doc
  tags/domains. Equivalence unit test proves chunk-0 payload matches
  the legacy builder output.
- find_context now enforces PBAC (review feedback): VIEW_ALL on
  glossaryTerm/metric/page upfront, the caller's SubjectContext is
  threaded into the candidate-asset search so glossary-routed
  candidates are RBAC-filtered, and relationship-routed candidates
  (metric APPLIED_TO, page HAS) are permission-checked per asset.

Verified: vector unit suite 194/194; VectorEmbeddingIntegrationIT 9/9
against real OpenSearch + DJL embeddings.

Co-Authored-By: Claude Fable 5 <[email protected]>
harshach added a commit that referenced this pull request Jul 6, 2026
…ge relevance

The truncated-article excerpt was the positional first-N chars — often an
intro, giving the LLM no signal about whether the substantive rule is
buried further down, so it can't decide whether to fetch the full body.

- Query-aware excerpts (Fix A): AIContextBuilder.withQuery(q) — threaded
  through get_asset_context (tool + tools.json) and the REST `?query=` on
  both /context endpoints. When a query is set and vectors are enabled, a
  truncated item's excerpt is the top query-relevant chunk
  (searchChunksByParent, #4789), so the snippet IS the relevant passage.
- Structural preview (Fix B): with no query, the excerpt is the lead
  paragraph plus a `Sections:` outline of the body's markdown headings —
  a compact map of what the document covers. Bumped EXCERPT_CHARS 500→800.
- Cap surfacing: capWithLog logs "dropped N of M articles/pills at the cap
  (unranked overflow)" instead of silently hard-dropping; relevance/recency
  ranking before the cap is the tracked follow-up.

Verified: AIContextBuilderTest 16/16 (structuralPreview outline + short
passthrough); AIContextMcpIT 6/6 (long article surfaces the Sections
outline in its excerpt); AIContextRestIT 6/6 (?query accepted, degrades
gracefully without vectors).

Co-Authored-By: Claude Fable 5 <[email protected]>
harshach added a commit that referenced this pull request Jul 8, 2026
…eddings (#29678)

* feat(ai-context): AI Context Platform — per-asset AIContext, MCP tools, multi-chunk embeddings

Fixes open-metadata/openmetadata-collate#4789: vector embedding discarded
all body chunks except chunk 0, so long Knowledge Articles were never
semantically retrievable past their opening.

- AIContext spec type (generic envelope + typed assetContext) and
  AIContextBuilder: schema + PK/FK/frequent-joins/partitions + attached
  glossary terms (table+column), Context Center articles, knowledge
  pills, applied metrics, depth-1 lineage, and observability (latest
  profile shape + data-quality standing).
- OKF-style markdown renderer for LLM consumption; JSON alternative.
- New MCP tools: get_asset_context (Mode A: one call returns the full
  context for a chosen asset) and find_context (Mode B: semantic search
  over glossary/metrics/articles routed to candidate assets).
- First-class metric→asset APPLIED_TO edge (metric.appliedToAssets on
  entity + create API + repository wiring).
- AIContextIndex mixin materializes structural context onto table
  search docs (aiContext blob + queryable aiContextForeignKeyTargets).
- /contextCenter/memories gains primaryEntityId filter; fixed pill
  resolution edge direction.
- #4789 fix: VectorDocBuilder emits one doc per chunk; dedicated
  data_asset_embeddings_chunks index (delete-stale + bulk index, keyed
  parentId_chunkIndex); dual-write keeps hybrid search intact; read
  path dedupes (parentId, chunkIndex); chunk cleanup on delete/soft
  delete.

Verified: 40+ new unit tests; VectorEmbeddingIntegrationIT 9/9 (real
OpenSearch + DJL embeddings, incl. multi-chunk + legacy regression);
AIContextMcpIT 3/3 end-to-end against the full application harness.

* Update generated TypeScript types

* fix(ai-context): reindex chunk backfill, single-embed dual write, find_context PBAC

- Reindex now populates the dedicated chunk index (issue #4789 backfill):
  the bulk sink writes all chunk docs when re-embedding, and backfills
  missing chunks (fingerprint-guarded, no-op once present) for entities
  whose cached embedding was reused — so one full reindex migrates an
  existing catalog to multi-chunk semantics.
- Combined updateEntityEmbeddings embeds each chunk once and reuses
  chunk 0 for the legacy entity-doc partial update (N embedding calls
  instead of N+1); wired into the lifecycle handler, the reembed CLI,
  and the reindex sink. legacyEmbeddingFields extracts only the
  embedding payload so chunk filter fields can never clobber entity-doc
  tags/domains. Equivalence unit test proves chunk-0 payload matches
  the legacy builder output.
- find_context now enforces PBAC (review feedback): VIEW_ALL on
  glossaryTerm/metric/page upfront, the caller's SubjectContext is
  threaded into the candidate-asset search so glossary-routed
  candidates are RBAC-filtered, and relationship-routed candidates
  (metric APPLIED_TO, page HAS) are permission-checked per asset.
pmbrull pushed a commit that referenced this pull request Jul 9, 2026
…4789) (#29850)

Backport the multi-chunk embedding fix from #29678 to 1.13, vector-pipeline
only. Excludes the AI Context Platform (REST /context, MCP tools,
AIContextBuilder, metric assets), which depends on 2.0-only server features
(Context Center, metric->asset edge).

VectorDocBuilder previously embedded only chunk 0 (~380 words) of an entity's
body, so long Knowledge Articles were not semantically retrievable past their
opening. VectorDocBuilder.fromEntity now emits one embedding document per body
chunk into a dedicated data_asset_embeddings_chunks index (deterministic
{parentId}_{chunkIndex} ids), dual-writing chunk 0 to the legacy entity-doc
embedding so hybrid search is unchanged and there is no migration cliff. Stale
chunks are cleaned on hard/soft delete, restore, and body shrink; a reindex
backfills existing entities (missing chunk header -> re-embed, fingerprint-skip
on subsequent runs).

The read side (RagHitProcessor top-N chunk merge in ai-platform) already ships
on 1.13 and lights up once the chunk index is populated.

VectorIndexService intentionally diverges from upstream by one method: the
preference/7-arg search overload (from #29503) is omitted because #29503 is not
on 1.13; only the #4789 chunk methods are added.

Fixes: open-metadata/openmetadata-collate#4789

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
mohityadav766 added a commit that referenced this pull request Jul 14, 2026
Resolves ES/OS sink conflicts (recordNonSearchableSkip alongside main's new
recordStaleReferenceWarning). Addresses #29541 review comments:
- VectorEmbeddingHandler: delete chunk docs when a memory flips to PRIVATE/SHARED
  so it stops matching KNN/vector queries (the #4789 chunk index isn't covered by
  the entity-doc delete).
- ContextMemoryIT: assert PRIVATE/SHARED stay absent over a window (awaitStaysAbsent)
  instead of a single point-in-time check.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants