Skip to content

[FEATURE] Implement WithFieldName interface for QueryBuilder implementations in plugins #1280

@dzane17

Description

@dzane17

Is your feature request related to a problem?

The Query Insights plugin utilizes the field name attribute in QueryBuilder objects to generate query shape. However, not all query types have a field name or a query may operate on multiple fields. To solve this, we created the WithFieldName interface to tag QueryBuilder implementations which contain a single field name.

Parent Issue: opensearch-project/query-insights#110

What solution would you like?

This plugin was identified to contain one or more applicable QueryBuilders. Please check for classes which meet the criteria and make the requisite changes.

  • Search for "extends AbstractQueryBuilder" inside the plugin repo to find candidate classes
  • If this query builder operates on a single field: 1) add extends WithFieldName & 2) override interface method fieldName() to return field name as String

Example KNN PR: opensearch-project/k-NN#2398

What alternatives have you considered?

A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions