Skip to content

Adding WithFieldName interface for QueryBuilders with fieldName#15705

Merged
jainankitk merged 3 commits intoopensearch-project:mainfrom
dzane17:qb-field-name
Sep 5, 2024
Merged

Adding WithFieldName interface for QueryBuilders with fieldName#15705
jainankitk merged 3 commits intoopensearch-project:mainfrom
dzane17:qb-field-name

Conversation

@dzane17
Copy link
Copy Markdown
Member

@dzane17 dzane17 commented Sep 4, 2024

Description

Adding WithFieldName interface and update QueryBuilder classes that conform - have a fieldName() implementation.

In the Query-Insights plugin, we would like to append fieldName and fieldType data during query shape construction. Some *QueryBuilder classes already provide a fieldName() method, but not all query types necessarily operate on a single field. Adding the WithFieldName interface provides a uniform way to type-check any *QueryBuilder instance and get a singular fieldName when possible. Also once fieldName is known, we can lookup fieldType via index mappings.

Related Issues

Related RFC opensearch-project/query-insights#69

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 4, 2024

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

@dzane17 dzane17 force-pushed the qb-field-name branch 2 times, most recently from 71d1cb1 to 9b6f465 Compare September 4, 2024 23:28
@dzane17 dzane17 changed the title Update QueryBuilders that implement MultiTermQueryBuilder interface Add WithFieldName interface Sep 4, 2024
@dzane17 dzane17 marked this pull request as ready for review September 4, 2024 23:36
Copy link
Copy Markdown
Contributor

@jainankitk jainankitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msfroh - Can you also provide your feedback on this PR?

@jainankitk
Copy link
Copy Markdown
Contributor

@dzane17 - Can you add CHANGELOG.md for this change?

dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 5, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 5, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 5, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 5, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
jainankitk added a commit that referenced this pull request Sep 5, 2024
… fieldName (#15765)

* Adding WithFieldName interface for QueryBuilders with fieldName (#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)

* Update CHANGELOG.md

Signed-off-by: Ankit Jain <akjain@amazon.com>

---------

Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 5, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 6, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 9, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Sep 9, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
jainankitk added a commit that referenced this pull request Sep 9, 2024
…) (#15763)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
(cherry picked from commit f5c897c)
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
…search-project#15705)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants