fix(vdb): add document_id keyword mapping and fix VectorType in elasticsearch-ja adapter (#40400)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Rafli Surya Wijaya
2026-08-21 10:35:54 +00:00
committed by GitHub
parent 6cb96adfbe
commit 385e8662bb
@@ -72,7 +72,10 @@ class ElasticSearchJaVector(ElasticSearchVector):
Field.METADATA_KEY: {
"type": "object",
"properties": {
"doc_id": {"type": "keyword"} # Map doc_id to keyword type
"doc_id": {"type": "keyword"}, # Map doc_id to keyword type
"document_id": {
"type": "keyword"
}, # Map document_id to keyword type; required for document-scoped retrieval
},
},
}
@@ -91,7 +94,7 @@ class ElasticSearchJaVectorFactory(ElasticSearchVectorFactory):
else:
dataset_id = dataset.id
collection_name = Dataset.gen_collection_name_by_id(dataset_id)
dataset.index_struct = json.dumps(self.gen_index_struct_dict(VectorType.ELASTICSEARCH, collection_name))
dataset.index_struct = json.dumps(self.gen_index_struct_dict(VectorType.ELASTICSEARCH_JA, collection_name))
config = current_app.config
return ElasticSearchJaVector(