opensearch-project/OpenSearch

[BUG] mandatory parameters in terms_set

Open

#18 261 ouverte le 12 mai 2025

Voir sur GitHub
 (11 commentaires) (0 réactions) (2 assignés)Java (1 505 forks)batch import
Searchbuggood first issue

Métriques du dépôt

Stars
 (8 123 stars)
Métriques de merge PR
 (Merge moyen 5j 9h) (266 PRs mergées en 30 j)

Description

Hello

It seems that the terms_set documentation ( https://docs.opensearch.org/docs/latest/query-dsl/term/terms-set/ ) is wrong when it states:

The < field > accepts the following parameters. All parameters except < terms > are optional.

If I write this query:

GET /XXX/_search { "query": { "bool": { "must": [ { "terms_set": { "provider": { "terms": [ 1,2 ] } } } ] } }, "size": 100, "version": true }

I get:

{ "error": { "root_cause": [ { "type": "query_shard_exception", "reason": "failed to create query: No minimum should match has been specified", "index": "XXX", "index_uuid": "HuMh0VE4STKSBT4eCUIYNA" } ], "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [ { "shard": 0, "index": "XXX", "node": "_ok60ix0RgmSTq4OLV6wxw", "reason": { "type": "query_shard_exception", "reason": "failed to create query: No minimum should match has been specified", "index": "XXX", "index_uuid": "HuMh0VE4STKSBT4eCUIYNA", "caused_by": { "type": "illegal_state_exception", "reason": "No minimum should match has been specified" } } } ] }, "status": 400 }

I suppose that exactly one option among minimum_should_match_field and minimum_should_match_script is expected . Both being set would be strange.

Related component

No response

To Reproduce

See my example

Expected behavior

The result should not complain or the documentation is wrong.

Additional Details

No response

Guide contributeur