Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FlatObject FieldMapper #6507

Merged
merged 29 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6218161
Add FlatObject FieldMapper
mingshl Feb 28, 2023
42f730a
resolve import package for HttpHost
mingshl Mar 7, 2023
5932bc7
Dynamic Create FlatObjectFieldType for dotpath field
mingshl Mar 21, 2023
86b22d9
Rename flat-object to flat_object and fix CI tests
mingshl Mar 22, 2023
70b680f
Organized package
mingshl Mar 22, 2023
da425e4
resolved compile error
mingshl Mar 22, 2023
4a7b503
organize package
mingshl Mar 22, 2023
cba30f5
Merge branch 'main' into flat-object-api
mingshl Mar 22, 2023
e98f06b
Add integration tests and remove benchmark
mingshl Mar 23, 2023
bdd5e29
fix IT tests
mingshl Mar 24, 2023
1753062
Skip IT tests before 2.7.0
mingshl Mar 24, 2023
0a5d0b9
Revert "Skip IT tests before 2.7.0"
mingshl Mar 24, 2023
cdf6797
Add more IT tests for supported queries
mingshl Mar 28, 2023
83a6b09
Removed license head and add tests for wildcard query
mingshl Mar 29, 2023
1670aa9
Add tests for array, nested-arrary, number and float
mingshl Mar 31, 2023
3504c05
Upgrade FlatObjectFieldMapperTests to MapperTestCase
lukas-vlcek Apr 3, 2023
37e646b
Add exist query in FlatObjectFieldMapperTests and FlatObjectFieldData…
mingshl Apr 3, 2023
b9e6223
Add IT tests for painless query in testDocValues
mingshl Apr 3, 2023
7a28527
Merge branch 'opensearch-project:main' into flat-object-api
mingshl Apr 3, 2023
3302ac3
Add filter script (Painless) test for flat_object
lukas-vlcek Apr 4, 2023
c8e51e9
Removed Normalizer
mingshl Apr 5, 2023
73f08d7
Merge remote-tracking branch 'origin/flat-object-api' into flat-objec…
mingshl Apr 5, 2023
a02a398
removed unused codes
mingshl Apr 5, 2023
e4546c7
Remove non-relevant Javadoc from DynamicKeyFieldMapper
lukas-vlcek Apr 6, 2023
e1c17f0
Improve flat_object scripting test
lukas-vlcek Apr 6, 2023
de2f32b
Add test for mapping parameters
lukas-vlcek Apr 6, 2023
27ee059
remove IndexAnalyzer from Builder
mingshl Apr 6, 2023
1f2206a
Merge remote-tracking branch 'origin/flat-object-api' into flat-objec…
mingshl Apr 6, 2023
543755f
remove IndexAnalyzer from Builder
mingshl Apr 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
- Require MediaType in Strings.toString API ([#6009](https:/opensearch-project/OpenSearch/pull/6009))
- [Refactor] XContent base classes from xcontent to core library ([#5902](https:/opensearch-project/OpenSearch/pull/5902))
- Added a new field type: flat_object ([#6507](https:/opensearch-project/OpenSearch/pull/6507))

### Deprecated
- Map, List, and Set in org.opensearch.common.collect ([#6609](https:/opensearch-project/OpenSearch/pull/6609))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,89 @@
}]
- match: { error.root_cause.0.type: "illegal_argument_exception" }
- match: { error.root_cause.0.reason: "script score function must not produce negative scores, but got: [-9.0]"}

---

"Flat-object fields from within the scripting":
- skip:
version: " - 2.99.99"
reason: "flat_object is introduced in 3.0.0 in main branch"

- do:
indices.create:
index: test
body:
mappings:
properties:
flat:
type : "flat_object"

- do:
index:
index: test
id: 1
body: {
"flat": {
"field_1": "John Doe",
"field_2": 33,
"field_3": false
}
}

- do:
index:
index: test
id: 2
body: {
"flat": {
"field_1": "Joe Public",
"field_2": 45
}
}

- do:
indices.refresh:
index: test

# It is possible to filter based on the number of fields in the flat-object
- do:
search:
body: {
_source: true,
query: {
bool: {
filter: {
script: {
script: {
source: "doc['flat'].size() > 2",
lang: "painless"
}
}
}
}
}
}

- length: { hits.hits: 1 }
- match: { hits.hits.0._source.flat.field_1: "John Doe" }

- do:
search:
body: {
_source: true,
query: {
bool: {
filter: {
script: {
script: {
source: "doc['flat'].size() < 3",
lang: "painless"
}
}
}
}
}
}

- length: { hits.hits: 1 }
- match: { hits.hits.0._source.flat.field_1: "Joe Public" }
Loading