Skip to content

OpenSearch Multi-Model component hardcodes method.name: disk_ann, breaking faiss/nmslib/lucene index creation #15094

Description

@johnhan2018

Bug Description

Bug description

The OpenSearch (Multi-Model Multi-Embedding) component hardcodes method.name to "disk_ann" when creating / updating knn_vector mappings, regardless of the selected Vector Engine.

When engine is set to faiss (or nmslib / lucene), OpenSearch rejects index creation with:

RequestError(400, 'mapper_parsing_exception',
  'Failed to parse mapping [_doc]: Invalid method name: disk_ann')

### Reproduction

1. Install Langflow 1.12.1
2. Install OpenSearch with standard opensearch-knn (no opensearch-jvector plugin)
3. Create a flow with:

- Embedding Model
- OpenSearch (Multi-Model Multi-Embedding)

4. Configure OpenSearch component:

- Vector Engine: faiss
- Distance Metric: cosinesimil
- Index Name: any new index name

5. Connect ingest data + embeddings and run

### Expected behavior

When engine=faiss, the component should create a mapping like:

{
  "type": "knn_vector",
  "dimension": <dim>,
  "method": {
    "name": "hnsw",
    "space_type": "cosinesimil",
    "engine": "faiss",
    "parameters": { "ef_construction": 512, "m": 16 }
  }
}
Actual behavior
The component sends:

{
  "method": {
    "name": "disk_ann",
    "engine": "faiss",
    ...
  }
}
OpenSearch returns Invalid method name: disk_ann.

Where in code
In lfx_bundles.elastic.opensearch_multimodal (and similarly in opensearch.py), mapping builders hardcode:

"method": {
    "name": "disk_ann",
    "space_type": space_type,
    "engine": engine,
    ...
}
Observed in:

_default_text_mapping(...)
_ensure_embedding_field_mapping(...)
Suggested fix
Derive method name from engine:

"name": "disk_ann" if engine == "jvector" else "hnsw"
Also consider:

exposing method as an advanced UI field, or
documenting that disk_ann requires the JVector plugin

### Who can help?

_No response_

### Operating System

MacOS 26

### Langflow Version

v1.12.1

### Python Version

3.12

### Screenshot

_No response_

### Flow File

_No response_

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingjiraThis issue has been logged in Jira for fix by the engineering team.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions