-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[DerivedField] object type support in mappings and new settings for derived field #13717
base: main
Are you sure you want to change the base?
[DerivedField] object type support in mappings and new settings for derived field #13717
Conversation
❌ Gradle check result for b5fd4b9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
b5fd4b9
to
635c12f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13717 +/- ##
============================================
+ Coverage 71.42% 71.73% +0.31%
- Complexity 59978 61409 +1431
============================================
Files 4985 5064 +79
Lines 282275 288151 +5876
Branches 40946 41734 +788
============================================
+ Hits 201603 206718 +5115
- Misses 63999 64388 +389
- Partials 16673 17045 +372 ☔ View full report in Codecov by Sentry. |
server/src/main/java/org/opensearch/index/mapper/DerivedField.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/mapper/DerivedField.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(name); | ||
out.writeString(type); | ||
script.writeTo(out); | ||
if (properties == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I should also check version here before adding a boolean flag to StreamOutput
for backward compatibility? As previous version doesn't have the properties
and other fields introduced here.
server/src/main/java/org/opensearch/index/mapper/DerivedField.java
Outdated
Show resolved
Hide resolved
635c12f
to
1c1ddbf
Compare
❌ Gradle check result for 1c1ddbf: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
1c1ddbf
to
36cae9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good!
Once we merge #13592, I think you'll need to rebase this (to avoid the redundant classes). I'll let you know once I've merged that one, then you can let me know once you've rebased this one.
Description
Introduces object type definition and following settings -
source_indexed_field
: This indexed field should be of typetext
and will be used to filter documents in 2 phased iterator approach before executing the expensiveDerivedFieldQuery
fetching from source, running script, deriving value, creating memory index. This is to improve the performance forobject
type.properties
: fieldname and field type can be specified explicity to avoid inferring the type of sub fields within object type.format
: date format to be used when type is inferred. Unrelated to object type and applicable to date type for both nested and non-nested fields.ignore_malformed
: ignores malformed documents for cases when field value cannot be derived or there is a type mismatch. If set to true, the query will ignore such documents and proceeds with rest of the matching documents.Example -
Diff will reduce once preceding PR is merged: #13592
Related Issues
Resolves #13715
#13592
Check List
[ ] Commit changes are listed out in CHANGELOG.md file (See: Changelog)[ ] Public documentation issue/PR createdBy 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.