opensearch-project / opensearch-project/security-analytics

[FEATURE] Implement WithFieldName interface for QueryBuilder implementations in plugins

Open
#1,509 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
111
Forks
111
Avg merge
1d 17h
Merged PRs (30d)
13

Description

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: https://github.com/opensearch-project/query-insights/issues/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: https://github.com/opensearch-project/k-NN/pull/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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the plugin repository for classes extending AbstractQueryBuilder, then inspect each candidate against the single-field criterion. Read the WithFieldName interface in OpenSearch's server/src/main/java/org/opensearch/index/query/WithFieldName.java and use the KNN PR as context. Done means applicable query builders extend the interface and return their field name from fieldName().

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.