Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
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
5 changes: 5 additions & 0 deletions docs/changelog/118586.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118586
summary: Bump timeout in `SemanticQueryBuilder` to 30s
area: Search
type: enhancement
issues: []
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 @@ -65,6 +65,7 @@ public class SemanticQueryBuilder extends AbstractQueryBuilder<SemanticQueryBuil
false,
args -> new SemanticQueryBuilder((String) args[0], (String) args[1], (Boolean) args[2])
);
private static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueSeconds(30);

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

Expand Down