Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
embedding; the chunk generation goes live with the entity indexes, and only a missed delete
blocks it; the header's count bounds every stored chunk id); v3 2026-11-23 (the Revisit clause
is resolved by a kNN query clause hook; fusing the two legs stays out of OpenMetadata); v4
2026-11-24 (ontology terms keep the engine split of their own record)
2026-11-24 (ontology terms keep the engine split of their own record); v5 2026-11-26 (the RRF
search pipeline is gone)
- **Deciders:** Search and AI context maintainers
- **Guard:** `VectorChunkIndexIT` (each scenario on a real cluster of each engine),
`ChunkSetBoundTest` (trims and deletes after a write that stopped part way),
Expand Down Expand Up @@ -120,7 +121,7 @@ Elasticsearch. With semantic search enabled on Elasticsearch:
`ontology_embeddings_chunks` on OpenSearch and their vectors on the term documents on
Elasticsearch, and only OpenSearch sweeps stale ontology chunks. The base class keeps that split
behind one hook, `chunksOntologyTerms`. Ontology terms are never part of the data-asset chunk
generation: its expected types are `AvailableEntityTypes.DATA_ASSET_CHUNK_TYPES`.
generation: its expected types are `EmbeddedEntityTypes.DATA_ASSETS`.
- **Hybrid search stays OpenSearch-only.** The RRF search pipeline lives in
`OpenSearchVectorService`, and `SearchRepository` creates and checks it only on OpenSearch.

Expand Down Expand Up @@ -165,3 +166,13 @@ semantic leg is the caller's concern and stays out of OpenMetadata
that make the two engines' kNN legs comparable). The OpenSearch RRF search pipeline remains until
its callers stop using it, and then leaves OpenMetadata
(ADR:2026-11-23-the-hybrid-rrf-pipeline-leaves-openmetadata).

## Amendment (v5, 2026-11-26)

The "Hybrid search stays OpenSearch-only" bullet no longer holds. The RRF search pipeline has left
OpenMetadata (ADR:2026-11-23-the-hybrid-rrf-pipeline-leaves-openmetadata), so
`OpenSearchVectorService` and `SearchRepository` neither create nor check one, on either engine.
OpenMetadata runs no hybrid query itself: a caller fuses its keyword leg with the clause
`knnQueryClause` returns, as the v3 amendment says. The list of embedded entity types is
`EmbeddedEntityTypes` (formerly `AvailableEntityTypes`), and the data-asset chunk generation expects
`EmbeddedEntityTypes.DATA_ASSETS`.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- **Status:** Accepted
- **Revisions:** v1 2026-11-23 (initial)
- **Deciders:** Pere Miquel Brull
- **Guard:** `OntologyTermSearchIT`, `OntologyTermIndexTest`, `AvailableEntityTypesConsistencyTest`
- **Guard:** `OntologyTermSearchIT`, `OntologyTermIndexTest`, `EmbeddedEntityTypesConsistencyTest`
- **Related:** ADR:2026-10-15-fuseki-holds-only-the-active-ontology-release, ADR:2026-10-19-native-concept-bindings-remain-operational-metadata

## Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The hybrid RRF search pipeline leaves OpenMetadata

- **Status:** Accepted
- **Revisions:** v1 2026-11-23 (initial)
- **Revisions:** v1 2026-11-23 (initial); v2 2026-11-26 (the deletion has landed)
- **Deciders:** Platform team
- **Guard:** `SearchRepositoryBehaviorTest.getHybridWeightsReadsTheAdminWeightsOfTheSearchSettings`
(the weights a caller fuses with); `reviewer` for new code that creates or reads a search
Expand Down Expand Up @@ -51,3 +51,14 @@ cluster-scoped write still happens on start, on Search Indexing runs and on sear
After it lands, a cluster that already holds a stored `hybrid-rrf` pipeline keeps it; nothing reads
or updates it, and an operator may delete it. Removing the `searchPipeline` key itself needs a
deprecation period in which configuration files drop it first.

## Amendment (v2, 2026-11-26)

The deletion landed in PR #38565, after the downstream caller moved to the building blocks. Every
member listed under Decision is gone, with its tests, the pipeline scenarios of
`VectorEmbeddingIntegrationIT`, the Search Indexing preflight step, the refresh on search settings
save and the pipeline check of the deployment status. The embeddings step of the deployment status
now only reports whether embeddings work, the same way on both engines. The configuration schema
documents `searchPipeline` as ignored, and the descriptions of `paginationDepth` and of the keyword
and semantic weights no longer mention a pipeline. The first paragraph of Consequences describes
the state before this amendment.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.openmetadata.service.search.vector.VectorDocBuilder;
import org.openmetadata.service.search.vector.VectorSearchParameters;
import org.openmetadata.service.search.vector.client.EmbeddingClient;
import org.openmetadata.service.search.vector.utils.AvailableEntityTypes;
import org.openmetadata.service.search.vector.utils.EmbeddedEntityTypes;
import org.opensearch.testcontainers.OpensearchContainer;
import org.testcontainers.elasticsearch.ElasticsearchContainer;
import org.testcontainers.utility.DockerImageName;
Expand Down Expand Up @@ -247,7 +247,7 @@ private static void assertAFullRecreateServesOnlyTheEntitiesItIndexed(
refresh(service, staged);
assertEquals(ids(seeded), parentsFound(service), "Reads keep the old chunks until the swap");

AvailableEntityTypes.SET.forEach(type -> service.markEntityTypeReindexed(type, true, staged));
EmbeddedEntityTypes.ALL.forEach(type -> service.markEntityTypeReindexed(type, true, staged));

assertEquals(ids(List.of(embeddedAgain, unchanged)), parentsFound(service));
assertOnePassage(service, embeddedAgain, "Orders placed online");
Expand Down Expand Up @@ -278,7 +278,7 @@ private static void assertAMissedChunkWriteStillPromotesAndTheNextWriteHealsIt(
service.writeEntityChunks(id(invoices), unindexableChunks(service, invoices), staged),
"The caller is told about the miss");
refresh(service, staged);
AvailableEntityTypes.SET.forEach(type -> service.markEntityTypeReindexed(type, true, staged));
EmbeddedEntityTypes.ALL.forEach(type -> service.markEntityTypeReindexed(type, true, staged));

assertEquals(
Set.of(service.getChunkIndexName(), service.getIndexAlias()), aliasesOf(service, staged));
Expand Down Expand Up @@ -310,7 +310,7 @@ private static void assertAProviderOutageOnAFirstRebuildStillPromotes(
assertFalse(service.backfillEntityChunks(shipments, staged), "The miss is reported");
provider.failing(false);
refresh(service, staged);
AvailableEntityTypes.SET.forEach(type -> service.markEntityTypeReindexed(type, true, staged));
EmbeddedEntityTypes.ALL.forEach(type -> service.markEntityTypeReindexed(type, true, staged));

assertEquals(
Set.of(service.getChunkIndexName(), service.getIndexAlias()), aliasesOf(service, staged));
Expand Down Expand Up @@ -348,7 +348,7 @@ private static void assertAFailedDeleteKeepsTheLiveChunks(AbstractVectorIndexSer
service.deleteEntityChunks(id(refunds));
refresh(service, service.getChunkIndexName());
String generation = staged;
AvailableEntityTypes.SET.forEach(
EmbeddedEntityTypes.ALL.forEach(
type -> service.markEntityTypeReindexed(type, true, generation));

assertEquals(Set.of(), aliasesOf(service, staged), "The generation is not promoted");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.function.Supplier;
import org.apache.hc.core5.http.HttpHost;
Expand All @@ -40,7 +39,6 @@
import org.testcontainers.utility.DockerImageName;
import os.org.opensearch.client.json.jackson.JacksonJsonpMapper;
import os.org.opensearch.client.opensearch.OpenSearchClient;
import os.org.opensearch.client.opensearch.generic.Requests;
import os.org.opensearch.client.transport.httpclient5.ApacheHttpClient5Transport;
import os.org.opensearch.client.transport.httpclient5.ApacheHttpClient5TransportBuilder;

Expand Down Expand Up @@ -276,97 +274,6 @@ void testBatchFingerprintOperations() throws Exception {
assertTrue(cached2.path("embedding").isArray() && !cached2.path("embedding").isEmpty());
}

@Test
void testEnsureHybridSearchPipelineCreatesAndUpdates() throws Exception {
vectorService.ensureHybridSearchPipeline(0.4, 0.6);

Map<String, Object> pipeline = getSearchPipeline(OpenSearchVectorService.HYBRID_PIPELINE_NAME);
assertNotNull(pipeline, "Pipeline should exist after creation");
assertWeightsInPipeline(pipeline, 0.4, 0.6);

vectorService.ensureHybridSearchPipeline(0.3, 0.7);

Map<String, Object> updatedPipeline =
getSearchPipeline(OpenSearchVectorService.HYBRID_PIPELINE_NAME);
assertNotNull(updatedPipeline, "Pipeline should still exist after update");
assertWeightsInPipeline(updatedPipeline, 0.3, 0.7);
}

@Test
void testCheckHybridSearchPipelineNeedsNoStoredPipeline() throws Exception {
deleteSearchPipeline(OpenSearchVectorService.HYBRID_PIPELINE_NAME);

assertTrue(
vectorService.checkHybridSearchPipeline(0.6, 0.4).isEmpty(),
"Hybrid search runs with the inline pipeline, so the check must pass without a stored one");

Optional<String> rejected = vectorService.checkHybridSearchPipeline(0.7, 0.7);
assertTrue(rejected.isPresent(), "OpenSearch rejects RRF weights that do not sum to 1.0");
assertTrue(rejected.get().contains("sum of weights"), rejected.get());
}

private void deleteSearchPipeline(String pipelineName) throws Exception {
// A 404 only means the pipeline was never created.
openSearchClient
.generic()
.execute(
Requests.builder()
.method("DELETE")
.endpoint("/_search/pipeline/" + pipelineName)
.build())
.close();
}

@SuppressWarnings("unchecked")
private Map<String, Object> getSearchPipeline(String pipelineName) throws Exception {
var genericClient = openSearchClient.generic();
try (var response =
genericClient.execute(
os.org.opensearch.client.opensearch.generic.Requests.builder()
.method("GET")
.endpoint("/_search/pipeline/" + pipelineName)
.build())) {
if (response.getStatus() == 404) {
return null;
}
String body =
response
.getBody()
.map(
b -> {
try {
return new String(b.bodyAsBytes(), java.nio.charset.StandardCharsets.UTF_8);
} catch (Exception e) {
return "{}";
}
})
.orElse("{}");
JsonNode root = mapper.readTree(body);
return mapper.convertValue(root.path(pipelineName), Map.class);
}
}

@SuppressWarnings("unchecked")
private void assertWeightsInPipeline(
Map<String, Object> pipeline, double expectedKeyword, double expectedSemantic) {
List<Map<String, Object>> processors =
(List<Map<String, Object>>) pipeline.get("phase_results_processors");
assertNotNull(processors, "Pipeline should have phase_results_processors");
assertFalse(processors.isEmpty(), "phase_results_processors should not be empty");

Map<String, Object> scoreRanker =
(Map<String, Object>) processors.get(0).get("score-ranker-processor");
assertNotNull(scoreRanker, "Pipeline should have score-ranker-processor");

Map<String, Object> combination = (Map<String, Object>) scoreRanker.get("combination");
assertEquals("rrf", combination.get("technique"));

Map<String, Object> parameters = (Map<String, Object>) combination.get("parameters");
List<Number> weights = (List<Number>) parameters.get("weights");
assertEquals(expectedKeyword, weights.get(0).doubleValue(), 0.001);
assertEquals(expectedSemantic, weights.get(1).doubleValue(), 0.001);
}

@Test
void testGenerateEmbeddingFields() {
Map<String, Object> fields = vectorService.generateEmbeddingFields(testTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.openmetadata.service.search.vector.VectorDocBuilder;
import org.openmetadata.service.search.vector.VectorIndexService;
import org.openmetadata.service.search.vector.client.EmbeddingClient;
import org.openmetadata.service.search.vector.utils.AvailableEntityTypes;
import org.openmetadata.service.search.vector.utils.EmbeddedEntityTypes;

/**
* The embedding step of a reindex bulk sink, the same on Elasticsearch and OpenSearch: it splices
Expand Down Expand Up @@ -59,7 +59,7 @@ private enum Embedded {
boolean isEnabledFor(String entityType) {
return searchRepository.isVectorEmbeddingEnabled()
&& searchRepository.getVectorIndexService() != null
&& AvailableEntityTypes.isVectorIndexable(entityType)
&& EmbeddedEntityTypes.isEmbedded(entityType)
&& searchRepository.getIndexMapping(entityType) != null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ private void preflightFixes() {
LOG.info("Running preflight fixes before reindexing");
markStaleRunningJobsStopped();
syncIndexTemplates();
ensureHybridSearchPipeline();
cleanupOrphanedIndicesPreFlight();
}

Expand All @@ -170,15 +169,6 @@ private void syncIndexTemplates() {
}
}

private void ensureHybridSearchPipeline() {
try {
searchRepository.ensureHybridSearchPipeline();
LOG.info("Preflight: ensured hybrid search pipeline is up to date");
} catch (Exception e) {
LOG.warn("Preflight: failed to ensure hybrid search pipeline: {}", e.getMessage());
}
}

private static final String APP_NAME = "SearchIndexingApplication";

private void markStaleRunningJobsStopped() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.openmetadata.service.search.SearchRepository;
import org.openmetadata.service.search.vector.UnrecordedStagedChunkDeleteException;
import org.openmetadata.service.search.vector.VectorIndexService;
import org.openmetadata.service.search.vector.utils.AvailableEntityTypes;
import org.openmetadata.service.search.vector.utils.EmbeddedEntityTypes;
import org.openmetadata.service.util.RestUtil;
import org.openmetadata.service.workflows.searchIndex.PaginatedEntitiesSource;
import org.openmetadata.service.workflows.searchIndex.PaginatedEntityTimeSeriesSource;
Expand Down Expand Up @@ -846,7 +846,7 @@ private static void requireStagedChunkFailuresRecorded(String entityType) {
SearchRepository searchRepository = Entity.getSearchRepository();
VectorIndexService vectorService =
searchRepository == null ? null : searchRepository.getVectorIndexService();
if (vectorService != null && AvailableEntityTypes.isVectorIndexable(entityType)) {
if (vectorService != null && EmbeddedEntityTypes.isEmbedded(entityType)) {
vectorService.requireStagedChunkFailuresRecorded();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1375,8 +1375,7 @@ StepValidation getEmbeddingsValidation(OpenMetadataApplicationConfig application
return embeddingResult;
}

return validateHybridSearchPipeline(
searchRepository, embeddingResult, description, configMessage);
return embeddingsWorking(embeddingResult, description, configMessage);
} catch (Exception e) {
LOG.error("Error during embedding generation validation", e);
return embeddingsValidation
Expand Down Expand Up @@ -1404,8 +1403,7 @@ private StepValidation retryInitAndReportError(
if (Boolean.FALSE.equals(embeddingResult.getPassed())) {
return embeddingResult;
}
return validateHybridSearchPipeline(
searchRepository, embeddingResult, description, configMessage);
return embeddingsWorking(embeddingResult, description, configMessage);
} catch (Exception e) {
LOG.error("Error during embedding generation validation after retry", e);
return embeddingsValidation
Expand Down Expand Up @@ -1439,36 +1437,12 @@ private StepValidation retryInitAndReportError(
.withPassed(false);
}

private StepValidation validateHybridSearchPipeline(
SearchRepository searchRepository,
StepValidation embeddingsValidation,
String description,
String configMessage) {
boolean usesPipeline = searchRepository.usesHybridSearchPipeline();
Optional<String> pipelineError =
usesPipeline ? searchRepository.checkHybridSearchPipeline() : Optional.empty();
String message =
pipelineError
.map(
error ->
"Embeddings are working but the hybrid search pipeline check failed: "
+ error
+ " "
+ configMessage)
.orElseGet(() -> workingMessage(usesPipeline, configMessage));
private static StepValidation embeddingsWorking(
StepValidation embeddingsValidation, String description, String configMessage) {
return embeddingsValidation
.withDescription(description)
.withMessage(message)
.withPassed(pipelineError.isEmpty());
}

/** An engine without the hybrid RRF pipeline has nothing to say about one. */
private static String workingMessage(boolean usesPipeline, String configMessage) {
String working =
usesPipeline
? "Embeddings and hybrid search pipeline are working correctly. %s"
: "Embeddings are working correctly. %s";
return String.format(working, configMessage);
.withMessage("Embeddings are working correctly. " + configMessage)
.withPassed(true);
}

private StepValidation validateEmbeddingGeneration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,27 +833,6 @@ public Response createOrUpdateSetting(
SearchSettings mergedSettings =
searchSettingsHandler.mergeSearchSettings(defaultSearchSettings, incomingSearchSettings);
settingName.setConfigValue(mergedSettings);

if (mergedSettings.getGlobalSettings() != null
&& mergedSettings.getGlobalSettings().getKeywordWeight() != null
&& mergedSettings.getGlobalSettings().getSemanticWeight() != null) {
try {
Entity.getSearchRepository()
.updateHybridSearchPipeline(
mergedSettings.getGlobalSettings().getKeywordWeight(),
mergedSettings.getGlobalSettings().getSemanticWeight());
} catch (Exception e) {
// Refreshing the named pipeline is a cluster-scoped write, so it fails outright on a
// deployment whose search role is confined to its own <clusterAlias>* prefix. Failing
// the whole settings save on that made search settings unsaveable there. The weights
// being saved here are the ones hybrid search reads per query, so they take effect
// regardless of whether the stored pipeline could be refreshed.
LOG.warn(
"Saved search settings but could not refresh the named hybrid search pipeline; "
+ "the new weights still apply to hybrid queries",
e);
}
}
}

LegacyRelationshipTypeUpdate relationshipTypeUpdate = null;
Expand Down
Loading
Loading