opensearch-project/OpenSearch

[BUG] mandatory parameters in terms_set

Open

#18,261 opened on 2025年5月12日

GitHub で見る
 (11 comments) (0 reactions) (2 assignees)Java (8,123 stars) (1,505 forks)batch import
Searchbuggood first issue

説明

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

コントリビューターガイド

[BUG] mandatory parameters in terms_set · opensearch-project/OpenSearch#18261 | Good First Issue