Skip to content

Commit 9ddee61

Browse files
authored
Flat object field should delegate to keyword field for most query types (#14383)
Signed-off-by: kkewwei <[email protected]>
1 parent 88d13eb commit 9ddee61

File tree

8 files changed

+1990
-258
lines changed

8 files changed

+1990
-258
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2424
- New `phone` & `phone-search` analyzer + tokenizer ([#15915](https://github.com/opensearch-project/OpenSearch/pull/15915))
2525
- Add _list/shards API as paginated alternate to _cat/shards ([#14641](https://github.com/opensearch-project/OpenSearch/pull/14641))
2626
- Latency and Memory allocation improvements to Multi Term Aggregation queries ([#14993](https://github.com/opensearch-project/OpenSearch/pull/14993))
27+
- Flat object field use IndexOrDocValuesQuery to optimize query ([#14383](https://github.com/opensearch-project/OpenSearch/issues/14383))
2728

2829
### Dependencies
2930
- Bump `com.azure:azure-identity` from 1.13.0 to 1.13.2 ([#15578](https://github.com/opensearch-project/OpenSearch/pull/15578))

rest-api-spec/src/main/resources/rest-api-spec/test/index/90_flat_object.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -671,38 +671,6 @@ teardown:
671671
- match: { error.root_cause.0.reason: "Mapping definition for [data] has unsupported parameters: [analyzer : standard]"}
672672
- match: { status: 400 }
673673

674-
# Wildcard Query with dot path.
675-
- do:
676-
catch: bad_request
677-
search:
678-
body: {
679-
_source: true,
680-
query: {
681-
"wildcard": {
682-
"catalog.title": "Mock*"
683-
}
684-
}
685-
}
686-
- match: { error.root_cause.0.type: "query_shard_exception" }
687-
- match: { error.root_cause.0.reason: "Can only use wildcard queries on keyword and text fields - not on [catalog.title] which is of type [flat_object]"}
688-
- match: { status: 400 }
689-
690-
# Wildcard Query without dot path.
691-
- do:
692-
catch: bad_request
693-
search:
694-
body: {
695-
_source: true,
696-
query: {
697-
"wildcard": {
698-
"catalog": "Mock*"
699-
}
700-
}
701-
}
702-
- match: { error.root_cause.0.type: "query_shard_exception" }
703-
- match: { error.root_cause.0.reason: "Can only use wildcard queries on keyword and text fields - not on [catalog] which is of type [flat_object]" }
704-
- match: { status: 400 }
705-
706674
# Aggregation and Match Query with dot path.
707675
- do:
708676
catch: bad_request

0 commit comments

Comments
 (0)