opensearch-project/OpenSearch

[BUG] mandatory parameters in terms_set

Open

#18.261 aberto em 12 de mai. de 2025

Ver no GitHub
 (11 comments) (0 reactions) (2 assignees)Java (1.505 forks)batch import
Searchbuggood first issue

Métricas do repositório

Stars
 (8.123 stars)
Métricas de merge de PR
 (Mesclagem média 5d 9h) (266 fundiu PRs em 30d)

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

Guia do colaborador