Skip to content

Add semantic and knn_vector mappings - #147

Open
esmarkowski wants to merge 1 commit into
feature/add-agentic-searchfrom
feature/add-semantic-and-knn-vector-mappings
Open

esmarkowski wants to merge 1 commit into
feature/add-agentic-searchfrom
feature/add-semantic-and-knn-vector-mappings

Conversation

@esmarkowski

@esmarkowski esmarkowski commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Adds the OpenSearch 3.1 semantic attribute type and the knn_vector mapping options that current OpenSearch supports.

attribute :body, :semantic, model_id: :text_embedding_model
# => { type: "semantic", model_id: "<deployed id>" }

attribute :vec, :knn_vector, dimension: 384, mode: "on_disk", compression_level: "32x"
  • semantic maps model_id, search_model_id, raw_field_type, semantic_info_field_name, chunking, semantic_field_search_analyzer, model_selection, dense_embedding_config, sparse_encoding_config and skip_existing_embedding. model_id and search_model_id resolve model classes through Resource.remote_id_for.
  • knn_vector adds data_type, space_type, mode, compression_level and model_id, and its examples use the faiss engine.
  • The attribute types list in docs/guides/models.md now includes both types.

Verified on OpenSearch 3.9.0. An on_disk, 32x knn_vector mapping round-trips. The server recognizes a semantic field and checks its model_id when the index is created.

Closes #140

Adds the OpenSearch 3.1 semantic field type. model_id and search_model_id
take a model id, class or class name and resolve to the remote id.

knn_vector now maps data_type, space_type, mode, compression_level and
model_id, and its docs use the faiss engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@esmarkowski
esmarkowski added this pull request to stack #142 November 16, 2026 22:44
@esmarkowski esmarkowski changed the title Add semantic type and current knn_vector options Add semantic and knn_vector mappings Nov 16, 2026
@esmarkowski
esmarkowski marked this pull request as ready for review November 16, 2026 22:45

This branch has not been deployed

No deployments
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.

Support semantic and current knn_vector mappings

1 participant