Skip to content

Add neural search ingest processors and neural_sparse query schemas - #1191

Open
Hailong-am wants to merge 5 commits into
opensearch-project:mainfrom
Hailong-am:feat/ingest-neural-processors
Open

Add neural search ingest processors and neural_sparse query schemas#1191
Hailong-am wants to merge 5 commits into
opensearch-project:mainfrom
Hailong-am:feat/ingest-neural-processors

Conversation

@Hailong-am

@Hailong-am Hailong-am commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Adds missing neural search schemas to the OpenAPI specification:

Ingest Processors (added to ProcessorContainer)

Processor Fields Description
sparse_encoding model_id, field_map, batch_size Generates sparse vector (token-weight) representations
text_image_embedding model_id, field_map Generates multimodal (text+image) vector embeddings
text_chunking algorithm, field_map, max_chunk_limit Splits long text into smaller chunks before embedding

Chunking Algorithm Schemas

  • ChunkingAlgorithm — wrapper with fixed_token_length or delimiter key
  • FixedTokenLengthChunkingAlgorithmtoken_limit, overlap_rate, tokenizer, max_chunk_limit
  • DelimiterChunkingAlgorithmdelimiter, max_chunk_limit

Query DSL: neural_sparse

Added NeuralSparseQuery to QueryContainer (field-keyed pattern, same as neural and knn):

  • query_text — text to encode into sparse tokens
  • model_id — sparse encoding model ID
  • query_tokens — pre-computed token weights (alternative to model inference)
  • max_token_score(deprecated since 2.12)
  • analyzer — tokenizer to use instead of ML model

Integration Test

  • text_chunking.yaml — validates text_chunking processor pipeline creation + document ingestion (no ML model required, version >= 2.13)

Validation

  • npm run lint:spec — 0 errors
  • npm run merge — resolves cleanly
  • npm run test:unit — 198 tests pass (39 suites)

References

…g processor schemas

Add neural search ingest processor schemas to ingest._common.yaml:

- SparseEncodingProcessor: sparse vector (token-weight) generation for
  neural sparse search. Fields: model_id (required), field_map (required),
  batch_size.
- TextImageEmbeddingProcessor: multimodal (text+image) embeddings.
  Fields: model_id (required), field_map (required).
- TextChunkingProcessor: splits long text into chunks before embedding.
  Fields: algorithm (required, ChunkingAlgorithm oneOf), field_map
  (required), max_chunk_limit.

Supporting schemas:
- ChunkingAlgorithm: oneOf FixedTokenLengthChunkingAlgorithm |
  DelimiterChunkingAlgorithm
- FixedTokenLengthChunkingAlgorithm: token_limit, overlap_rate,
  tokenizer, max_chunk_limit
- DelimiterChunkingAlgorithm: delimiter, max_chunk_limit

All three processors are registered in ProcessorContainer alongside
the existing text_embedding processor.

Signed-off-by: Hailong Cui <ihailong@amazon.com>
@Hailong-am
Hailong-am force-pushed the feat/ingest-neural-processors branch from b7b6b72 to 98756b6 Compare August 12, 2026 15:33
Signed-off-by: Hailong Cui <ihailong@amazon.com>
The sparse encoding model (opensearch-neural-sparse-encoding-doc-v1)
takes too long to register in CI, causing timeout failures. The existing
neural_search.yaml test already validates the ingest pipeline PUT schema
with a text_embedding processor. The sparse_encoding processor schema
is validated structurally via lint and unit tests.

Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
@Hailong-am Hailong-am changed the title feat(ingest): add sparse_encoding, text_image_embedding, text_chunking processor schemas Add neural search ingest processors and neural_sparse query schemas Aug 13, 2026
@Hailong-am

Copy link
Copy Markdown
Contributor Author

@harshavamsi can you help to review it?

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.

1 participant