Skip to content

Commit 08037b3

Browse files
committed
remove unused variables
Signed-off-by: Karen X <[email protected]>
1 parent 84e5135 commit 08037b3

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

modules/transport-grpc/src/main/java/org/opensearch/transport/grpc/proto/request/search/query/IdsQueryBuilderProtoUtils.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
package org.opensearch.transport.grpc.proto.request.search.query;
99

10-
import org.opensearch.index.query.AbstractQueryBuilder;
1110
import org.opensearch.index.query.IdsQueryBuilder;
1211
import org.opensearch.protobufs.IdsQuery;
1312

@@ -32,22 +31,17 @@ private IdsQueryBuilderProtoUtils() {
3231
* @return A configured IdsQueryBuilder instance
3332
*/
3433
static IdsQueryBuilder fromProto(IdsQuery idsQueryProto) {
35-
String queryName = null;
36-
float boost = AbstractQueryBuilder.DEFAULT_BOOST;
37-
3834
// Create IdsQueryBuilder
3935
IdsQueryBuilder idsQuery = new IdsQueryBuilder();
4036

41-
// Process name
37+
// Process name (only set when present)
4238
if (idsQueryProto.hasXName()) {
43-
queryName = idsQueryProto.getXName();
44-
idsQuery.queryName(queryName);
39+
idsQuery.queryName(idsQueryProto.getXName());
4540
}
4641

47-
// Process boost
42+
// Process boost (only set when present)
4843
if (idsQueryProto.hasBoost()) {
49-
boost = idsQueryProto.getBoost();
50-
idsQuery.boost(boost);
44+
idsQuery.boost(idsQueryProto.getBoost());
5145
}
5246

5347
// Process values (ids)

modules/transport-grpc/src/main/java/org/opensearch/transport/grpc/proto/request/search/query/TermsSetQueryBuilderProtoUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ static TermsSetQueryBuilder fromProto(org.opensearch.protobufs.TermsSetQuery ter
7474
minimumShouldMatchScript = ScriptProtoUtils.parseFromProtoRequest(termsSetQueryProto.getMinimumShouldMatchScript());
7575
}
7676

77-
TermsSetQueryBuilder queryBuilder = new TermsSetQueryBuilder(fieldName, values).queryName(queryName).boost(boost);
77+
TermsSetQueryBuilder queryBuilder = new TermsSetQueryBuilder(fieldName, values);
78+
79+
queryBuilder.boost(boost);
80+
queryBuilder.queryName(queryName);
7881

7982
if (minimumShouldMatchField != null) {
8083
queryBuilder.setMinimumShouldMatchField(minimumShouldMatchField);

0 commit comments

Comments
 (0)