-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[GRPC] Add terms query support in Search GRPC endpoint #17888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 5e22ed37e4535c9c9cfeb8993f5294ba1201795c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| package org.opensearch.plugin.transport.grpc.proto.request.common; | ||
|
|
||
| import org.opensearch.action.DocWriteRequest; | ||
| import org.opensearch.protobufs.OpType; | ||
|
|
||
| /** | ||
| * Utility class for converting SourceConfig Protocol Buffers to FetchSourceContext objects. | ||
| * This class handles the conversion of Protocol Buffer representations to their | ||
| * corresponding OpenSearch objects. | ||
| */ | ||
| public class OpTypeProtoUtils { | ||
|
|
||
| private OpTypeProtoUtils() { | ||
| // Utility class, no instances | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * Similar to {@link DocWriteRequest.OpType} | ||
| * | ||
| * @param opType | ||
| * @return | ||
| */ | ||
| public static DocWriteRequest.OpType fromProto(OpType opType) { | ||
|
|
||
| switch (opType) { | ||
| case OP_TYPE_CREATE: | ||
| return DocWriteRequest.OpType.CREATE; | ||
|
Check warning on line 36 in plugins/transport-grpc/src/main/java/org/opensearch/plugin/transport/grpc/proto/request/common/OpTypeProtoUtils.java
|
||
| case OP_TYPE_INDEX: | ||
| return DocWriteRequest.OpType.INDEX; | ||
|
Check warning on line 38 in plugins/transport-grpc/src/main/java/org/opensearch/plugin/transport/grpc/proto/request/common/OpTypeProtoUtils.java
|
||
| default: | ||
| throw new UnsupportedOperationException("Invalid optype: " + opType); | ||
|
Check warning on line 40 in plugins/transport-grpc/src/main/java/org/opensearch/plugin/transport/grpc/proto/request/common/OpTypeProtoUtils.java
|
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| package org.opensearch.plugin.transport.grpc.proto.request.common; | ||
|
|
||
| import org.opensearch.action.support.WriteRequest; | ||
|
|
||
| /** | ||
| * Utility class for converting SourceConfig Protocol Buffers to FetchSourceContext objects. | ||
| * This class handles the conversion of Protocol Buffer representations to their | ||
| * corresponding OpenSearch objects. | ||
| */ | ||
| public class RefreshProtoUtils { | ||
|
|
||
| private RefreshProtoUtils() { | ||
| // Utility class, no instances | ||
| } | ||
|
|
||
| /** | ||
| * Extracts the refresh policy from the bulk request. | ||
| * | ||
| * @param refresh The bulk request containing the refresh policy | ||
| * @return The refresh policy as a string, or null if not specified | ||
| */ | ||
| public static String getRefreshPolicy(org.opensearch.protobufs.Refresh refresh) { | ||
| switch (refresh) { | ||
| case REFRESH_TRUE: | ||
| return WriteRequest.RefreshPolicy.IMMEDIATE.getValue(); | ||
| case REFRESH_WAIT_FOR: | ||
| return WriteRequest.RefreshPolicy.WAIT_UNTIL.getValue(); | ||
| case REFRESH_FALSE: | ||
| case REFRESH_UNSPECIFIED: | ||
| default: | ||
| return WriteRequest.RefreshPolicy.NONE.getValue(); | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.