Skip to content

Commit

Permalink
bump timeout in SQB to 30s
Browse files Browse the repository at this point in the history
  • Loading branch information
tteofili committed Dec 12, 2024
1 parent e7a4436 commit 9bc1966
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.elasticsearch.cluster.metadata.InferenceFieldMetadata;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.features.NodeFeature;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.query.AbstractQueryBuilder;
Expand All @@ -32,7 +33,6 @@
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xpack.core.inference.action.InferenceAction;
import org.elasticsearch.xpack.core.ml.action.InferModelAction;
import org.elasticsearch.xpack.core.ml.inference.results.ErrorInferenceResults;
import org.elasticsearch.xpack.core.ml.inference.results.MlTextEmbeddingResults;
import org.elasticsearch.xpack.core.ml.inference.results.TextExpansionResults;
Expand Down Expand Up @@ -63,6 +63,7 @@ public class SemanticQueryBuilder extends AbstractQueryBuilder<SemanticQueryBuil
false,
args -> new SemanticQueryBuilder((String) args[0], (String) args[1])
);
private static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueSeconds(30);

static {
PARSER.declareString(constructorArg(), FIELD_FIELD);
Expand Down Expand Up @@ -208,7 +209,7 @@ private SemanticQueryBuilder doRewriteGetInferenceResults(QueryRewriteContext qu
List.of(query),
Map.of(),
InputType.SEARCH,
InferModelAction.Request.DEFAULT_TIMEOUT_FOR_API,
DEFAULT_TIMEOUT,
false
);

Expand Down

0 comments on commit 9bc1966

Please sign in to comment.