Skip to content

Commit

Permalink
Implement WithFieldName interface in ValuesSourceAggregationBuilder
Browse files Browse the repository at this point in the history
Signed-off-by: David Zane <davizane@amazon.com>
  • Loading branch information
dzane17 committed Sep 12, 2024
1 parent 2e98df3 commit 95fff6b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.index.query.QueryShardContext;
import org.opensearch.index.query.WithFieldName;
import org.opensearch.script.Script;
import org.opensearch.search.aggregations.AbstractAggregationBuilder;
import org.opensearch.search.aggregations.AggregationInitializationException;
Expand All @@ -57,7 +58,9 @@
*
* @opensearch.internal
*/
public abstract class ValuesSourceAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>> extends AbstractAggregationBuilder<AB> {
public abstract class ValuesSourceAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>> extends AbstractAggregationBuilder<AB>
implements
WithFieldName {

public static <T> void declareFields(
AbstractObjectParser<? extends ValuesSourceAggregationBuilder<?>, T> objectParser,
Expand Down Expand Up @@ -292,6 +295,11 @@ public String field() {
return field;
}

@Override
public String fieldName() {
return field();

Check warning on line 300 in server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java#L300

Added line #L300 was not covered by tests
}

/**
* Sets the script to use for this aggregation.
*/
Expand Down

0 comments on commit 95fff6b

Please sign in to comment.