-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Enable Partial Flat Object #7997
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mingshl
requested review from
reta,
anasalkouz,
andrross,
Bukhtawar,
CEHENKLE,
dblock,
gbbafna,
setiah,
kartg,
kotwanikunal,
mch2,
nknize,
owaiskazi19,
Rishikesh1159,
ryanbogan,
saratvemulapalli,
shwetathareja,
dreamer-89,
tlfeng,
VachaShah and
dbwiddis
as code owners
June 9, 2023 23:34
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #7997 +/- ##
============================================
+ Coverage 70.90% 70.97% +0.07%
- Complexity 56903 56939 +36
============================================
Files 4758 4758
Lines 269225 269234 +9
Branches 39407 39403 -4
============================================
+ Hits 190881 191092 +211
+ Misses 62256 62041 -215
- Partials 16088 16101 +13
|
Gradle Check (Jenkins) Run Completed with:
|
@mingshl can you add tests for the new changes? |
reta
reviewed
Jun 15, 2023
rest-api-spec/src/main/resources/rest-api-spec/test/index/100_partial_flat_object.yml
Outdated
Show resolved
Hide resolved
reta
reviewed
Jun 15, 2023
rest-api-spec/src/main/resources/rest-api-spec/test/index/100_partial_flat_object.yml
Show resolved
Hide resolved
reta
reviewed
Jun 15, 2023
rest-api-spec/src/main/resources/rest-api-spec/test/index/100_partial_flat_object.yml
Outdated
Show resolved
Hide resolved
mingshl
force-pushed
the
partial-flat-object
branch
from
July 5, 2023 07:26
efb1aed
to
3ec3362
Compare
Gradle Check (Jenkins) Run Completed with:
|
reta
reviewed
Jul 6, 2023
server/src/main/java/org/opensearch/index/mapper/FlatObjectFieldMapper.java
Outdated
Show resolved
Hide resolved
mingshl
force-pushed
the
partial-flat-object
branch
from
July 6, 2023 19:08
3ec3362
to
e9a25c7
Compare
Gradle Check (Jenkins) Run Completed with:
|
reta
approved these changes
Jul 6, 2023
reta
reviewed
Jul 6, 2023
server/src/test/java/org/opensearch/index/mapper/FlatObjectFieldTypeTests.java
Show resolved
Hide resolved
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
mingshl
force-pushed
the
partial-flat-object
branch
from
July 7, 2023 02:01
e9a25c7
to
4db5e12
Compare
Gradle Check (Jenkins) Run Completed with:
|
mingshl
added
v2.9.0
'Issues and PRs related to version v2.9.0'
backport 2.x
Backport to 2.x branch
labels
Jul 7, 2023
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jul 7, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> (cherry picked from commit d333cd3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta
pushed a commit
that referenced
this pull request
Jul 7, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- (cherry picked from commit d333cd3) Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vikasvb90
pushed a commit
to raghuvanshraj/OpenSearch
that referenced
this pull request
Jul 12, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com>
raghuvanshraj
pushed a commit
to raghuvanshraj/OpenSearch
that referenced
this pull request
Jul 12, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com>
dzane17
pushed a commit
to dzane17/OpenSearch
that referenced
this pull request
Jul 12, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com>
buddharajusahil
pushed a commit
to buddharajusahil/OpenSearch
that referenced
this pull request
Jul 18, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: sahil buddharaju <sahilbud@amazon.com>
baba-devv
pushed a commit
to baba-devv/OpenSearch
that referenced
this pull request
Jul 29, 2023
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com>
shiv0408
pushed a commit
to Gaurav614/OpenSearch
that referenced
this pull request
Apr 25, 2024
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport 2.x
Backport to 2.x branch
Search
Search query, autocomplete ...etc
v2.9.0
'Issues and PRs related to version v2.9.0'
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Before this PR, flat_object can only be defined at the root field of JSON object in 2.7 and 2.8, because the json object is flatten so it lost the structure of a tree. Now, this PR enables json object to be partially mapped as flat_object field type while other fields in the JSON can be other field type.
The main idea is to remember the flat object field name as
mappedFieldTypeName
in the dynamic created field (only in query time and it will vanish after returning result), which helps the logic to identify the starting point of a flat object, to decide if a query contains a dot path after flat object field name.In the example given in the issue,
issue.label
is defined as a flat_object, soissue.labels
is the flat object field name, andissue.label.comment
contains a dot path after the flat_object field name .Related Issues
#7136
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.