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

[DerivedField] Support DerivedField object type and integration with Mapper #13720

Merged
merged 11 commits into from
Jun 6, 2024

Conversation

rishabhmaurya
Copy link
Contributor

@rishabhmaurya rishabhmaurya commented May 16, 2024

Description

Support DerivedField object type and integration with Mapper and DerivedField query

  • Adds ValueFetcher for DerivedField of object type to parse and fetch nested fields.
  • DerivedFieldResolver to resolve DerivedField type on the fly. And DerivedFieldResolverFactory to decide between NoOp and Default implementation.
  • Introduction of new support types - text, float and object.
  • Use index analyzer for derived fields set in index settings.
  • Integrations of properties - source_indexed_field, properties, format , ignore_malformed introduced in [DerivedField] object type support in mappings and new settings for derived field  #13717 to make them functional.
  • Support of derived fields from query string
  • Disable feature when allow_expensive_query is set to false.
  • Index and cluster level setting index.query.derived_field.enabled and search.derived_field.enabled respectively, to enable/disable feature on dynamically.

PR diff will reduce once preceding PRs are merged - #13592 and #13717

Related Issues

Resolves #13715

#13592

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • API changes companion pull request created.
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • [ ] Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • [ ] Public documentation issue/PR created

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.

@rishabhmaurya rishabhmaurya self-assigned this May 16, 2024
@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities labels May 16, 2024
@rishabhmaurya rishabhmaurya added skip-changelog and removed enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities labels May 16, 2024
@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities labels May 16, 2024
Copy link
Contributor

❌ Gradle check result for 0af215e: 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?

Copy link
Contributor

❌ Gradle check result for 51b813e: 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?

Copy link
Contributor

github-actions bot commented Jun 3, 2024

❌ Gradle check result for 4779e9c: 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?

Copy link
Contributor

github-actions bot commented Jun 3, 2024

✅ Gradle check result for dedfe13: SUCCESS

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 79.70402% with 96 lines in your changes missing coverage. Please review.

Project coverage is 71.68%. Comparing base (b15cb0c) to head (c4d2149).
Report is 344 commits behind head on main.

Files Patch % Lines
.../org/opensearch/index/mapper/DerivedFieldType.java 56.73% 60 Missing and 1 partial ⚠️
...rg/opensearch/index/mapper/DerivedFieldMapper.java 84.12% 6 Missing and 4 partials ⚠️
...pensearch/index/mapper/ObjectDerivedFieldType.java 79.16% 6 Missing and 4 partials ⚠️
...arch/index/mapper/DefaultDerivedFieldResolver.java 94.84% 1 Missing and 4 partials ⚠️
...java/org/opensearch/script/DerivedFieldScript.java 0.00% 3 Missing ⚠️
...java/org/opensearch/index/mapper/DerivedField.java 81.81% 0 Missing and 2 partials ⚠️
...earch/index/mapper/DerivedFieldSupportedTypes.java 94.87% 1 Missing and 1 partial ⚠️
...arch/index/mapper/DerivedFieldResolverFactory.java 92.30% 1 Missing ⚠️
...nsearch/index/mapper/DerivedFieldValueFetcher.java 66.66% 0 Missing and 1 partial ⚠️
...index/query/VectorGeoPointShapeQueryProcessor.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13720      +/-   ##
============================================
+ Coverage     71.42%   71.68%   +0.26%     
- Complexity    59978    61410    +1432     
============================================
  Files          4985     5069      +84     
  Lines        282275   288555    +6280     
  Branches      40946    41781     +835     
============================================
+ Hits         201603   206839    +5236     
- Misses        63999    64615     +616     
- Partials      16673    17101     +428     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Jun 4, 2024

❌ Gradle check result for f204de0: 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?

* ValueFetcher for DerivedField of object type to parse and fetch nested fields.
* DerivedFieldResolver to resolve DerivedField type on the fly.
* Introduction of new support types - text, float.
* Use index analyzer for derived fields set in index settings.
* Support of derived fields from query string
* Unit tests

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Copy link
Contributor

github-actions bot commented Jun 5, 2024

❌ Gradle check result for 4baf532: 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?

…rivedFieldQuery

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Copy link
Contributor

github-actions bot commented Jun 5, 2024

❕ Gradle check result for 1d79fa8: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

github-actions bot commented Jun 5, 2024

❌ Gradle check result for 6c1ff16: 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 <rishabhmaurya05@gmail.com>
Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
Copy link
Contributor

github-actions bot commented Jun 5, 2024

✅ Gradle check result for a78b936: SUCCESS

Copy link
Contributor

github-actions bot commented Jun 5, 2024

✅ Gradle check result for c4d2149: SUCCESS

@getsaurabh02 getsaurabh02 merged commit 9da6170 into opensearch-project:main Jun 6, 2024
30 checks passed
@rishabhmaurya rishabhmaurya added the backport 2.x Backport to 2.x branch label Jun 9, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 9, 2024
…Mapper (#13720)

* Support DerivedField object type

* ValueFetcher for DerivedField of object type to parse and fetch nested fields.
* DerivedFieldResolver to resolve DerivedField type on the fly.
* Introduction of new support types - text, float.
* Use index analyzer for derived fields set in index settings.
* Support of derived fields from query string
* Unit tests

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Derived field object type properties to also support Object as a value

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Index and cluster setting to control derived fields

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Fix test

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Fixed missing javadoc

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Fix the rewrite issue when profile is set as true

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Address PR comments

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Address PR comments

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* Use conjuction query with filter on source_indexed_field query and DerivedFieldQuery

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* support source_indexed_field for non-object type derived fields

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

* rename source_indexed_field to prefilter_field

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

---------

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
(cherry picked from commit 9da6170)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.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 enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities skip-changelog
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request] Support mapping for object type and new settings for derived fields
4 participants