Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump opensearch-protobufs dependency to 0.24.0 and update transport-grpc module compatibility ([#20059](https://github.com/opensearch-project/OpenSearch/pull/20059))

- Refactor the ShardStats, WarmerStats and IndexingPressureStats class to use the Builder pattern instead of constructors ([#19966](https://github.com/opensearch-project/OpenSearch/pull/19966))
- Throw exceptions for currently unsupported GRPC request-side fields ([#20162](https://github.com/opensearch-project/OpenSearch/pull/20162))

### Fixed
- Fix Allocation and Rebalance Constraints of WeightFunction are incorrectly reset ([#19012](https://github.com/opensearch-project/OpenSearch/pull/19012))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ public static org.opensearch.action.bulk.BulkRequest prepareRequest(BulkRequest
)
);

// Type is a deprecated field according to the spec, thus no plans to support it
if (request.hasType()) {
throw new UnsupportedOperationException("type param is not supported");
}

// TODO support global_params
if (request.hasGlobalParams()) {
throw new UnsupportedOperationException("global_params param is not supported yet");
}

return bulkRequest;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ protected static void parseSearchRequest(
? parseTimeValue(request.getCancelAfterTimeInterval(), null, "cancel_after_time_interval")
: null
);

// TODO support typed_keys
if (request.hasTypedKeys()) {
throw new UnsupportedOperationException("typed_keys param is not supported yet");
}

// TODO support global_params
if (request.hasGlobalParams()) {
throw new UnsupportedOperationException("global_params param is not supported yet");
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.opensearch.transport.grpc.proto.request.common.ScriptProtoUtils;
import org.opensearch.transport.grpc.proto.request.search.query.AbstractQueryBuilderProtoUtils;
import org.opensearch.transport.grpc.proto.request.search.sort.SortBuilderProtoUtils;
import org.opensearch.transport.grpc.proto.request.search.suggest.SuggestBuilderProtoUtils;
import org.opensearch.transport.grpc.spi.QueryBuilderProtoConverterRegistry;

import java.io.IOException;
Expand Down Expand Up @@ -154,15 +153,18 @@ private static void parseNonQueryFields(
}

// TODO support aggregations
/*
if(protoRequest.hasAggs()){}
*/
if (protoRequest.getAggregationsCount() > 0) {
throw new UnsupportedOperationException("aggregations param is not supported yet");
}

if (protoRequest.hasHighlight()) {
searchSourceBuilder.highlighter(HighlightBuilderProtoUtils.fromProto(protoRequest.getHighlight(), registry));
}

// TODO support suggest
if (protoRequest.hasSuggest()) {
searchSourceBuilder.suggest(SuggestBuilderProtoUtils.fromProto(protoRequest.getSuggest()));
throw new UnsupportedOperationException("suggest param is not supported yet");
// searchSourceBuilder.suggest(SuggestBuilderProtoUtils.fromProto(protoRequest.getSuggest()));
}
if (protoRequest.getRescoreCount() > 0) {
for (Rescore rescore : protoRequest.getRescoreList()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ private static TermsLookup parseTermsLookup(org.opensearch.protobufs.TermsLookup
if (lookup.hasRouting()) {
tl.routing(lookup.getRouting());
}
if (lookup.hasStore()) {
tl.store(lookup.getStore());
}
return tl;
}
}
Loading