Fix compilation due to changes in elastic/elasticsearchelastic/elasticsearch#15511.
Original commit: elastic/x-pack-elasticsearch@5a6e77a246
This commit is contained in:
parent
7691859baa
commit
53a757a5de
|
@ -7,7 +7,7 @@ package org.elasticsearch.watcher.condition.compare;
|
|||
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.ShardSearchFailure;
|
||||
import org.elasticsearch.common.text.StringText;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.search.SearchShardTarget;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
|
||||
|
@ -79,7 +79,7 @@ public class CompareConditionSearchTests extends AbstractWatcherIntegrationTestC
|
|||
|
||||
public void testExecuteAccessHits() throws Exception {
|
||||
ExecutableCompareCondition condition = new ExecutableCompareCondition(new CompareCondition("ctx.payload.hits.hits.0._score", CompareCondition.Op.EQ, 1), logger, SystemClock.INSTANCE);
|
||||
InternalSearchHit hit = new InternalSearchHit(0, "1", new StringText("type"), null);
|
||||
InternalSearchHit hit = new InternalSearchHit(0, "1", new Text("type"), null);
|
||||
hit.score(1f);
|
||||
hit.shard(new SearchShardTarget("a", "a", 0));
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.elasticsearch.watcher.condition.script;
|
|||
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.ShardSearchFailure;
|
||||
import org.elasticsearch.common.text.StringText;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.search.SearchShardTarget;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
|
||||
|
@ -81,7 +81,7 @@ public class ScriptConditionSearchTests extends AbstractWatcherIntegrationTestCa
|
|||
|
||||
public void testExecuteAccessHits() throws Exception {
|
||||
ExecutableScriptCondition condition = new ExecutableScriptCondition(new ScriptCondition(Script.inline("ctx.payload.hits?.hits[0]?._score == 1.0").build()), logger, scriptService);
|
||||
InternalSearchHit hit = new InternalSearchHit(0, "1", new StringText("type"), null);
|
||||
InternalSearchHit hit = new InternalSearchHit(0, "1", new Text("type"), null);
|
||||
hit.score(1f);
|
||||
hit.shard(new SearchShardTarget("a", "a", 0));
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.elasticsearch.cluster.routing.UnassignedInfo;
|
|||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.text.StringText;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.search.SearchShardTarget;
|
||||
|
@ -267,7 +267,7 @@ public class TriggeredWatchStoreTests extends ESTestCase {
|
|||
SearchResponse searchResponse1 = mock(SearchResponse.class);
|
||||
when(searchResponse1.getSuccessfulShards()).thenReturn(1);
|
||||
when(searchResponse1.getTotalShards()).thenReturn(1);
|
||||
InternalSearchHit hit = new InternalSearchHit(0, "_id", new StringText("_type"), null);
|
||||
InternalSearchHit hit = new InternalSearchHit(0, "_id", new Text("_type"), null);
|
||||
hit.version(1l);
|
||||
hit.shard(new SearchShardTarget("_node_id", indexName, 0));
|
||||
hit.sourceRef(new BytesArray("{}"));
|
||||
|
@ -277,7 +277,7 @@ public class TriggeredWatchStoreTests extends ESTestCase {
|
|||
when(clientProxy.search(any(SearchRequest.class), any(TimeValue.class))).thenReturn(searchResponse1);
|
||||
|
||||
// First return a scroll response with a single hit and then with no hits
|
||||
hit = new InternalSearchHit(0, "_id", new StringText("_type"), null);
|
||||
hit = new InternalSearchHit(0, "_id", new Text("_type"), null);
|
||||
hit.version(1l);
|
||||
hit.shard(new SearchShardTarget("_node_id", indexName, 0));
|
||||
hit.sourceRef(new BytesArray("{}"));
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.elasticsearch.cluster.routing.UnassignedInfo;
|
|||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.text.StringText;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.search.SearchHitField;
|
||||
|
@ -230,17 +230,17 @@ public class WatchStoreTests extends ESTestCase {
|
|||
when(clientProxy.refresh(any(RefreshRequest.class))).thenReturn(refreshResponse);
|
||||
|
||||
BytesReference source = new BytesArray("{}");
|
||||
InternalSearchHit hit1 = new InternalSearchHit(0, "_id1", new StringText("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
InternalSearchHit hit1 = new InternalSearchHit(0, "_id1", new Text("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
hit1.sourceRef(source);
|
||||
InternalSearchHit hit2 = new InternalSearchHit(1, "_id2", new StringText("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
InternalSearchHit hit2 = new InternalSearchHit(1, "_id2", new Text("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
hit2.sourceRef(source);
|
||||
SearchResponse searchResponse1 = mockSearchResponse(1, 1, 2, hit1, hit2);
|
||||
|
||||
when(clientProxy.search(any(SearchRequest.class), any(TimeValue.class))).thenReturn(searchResponse1);
|
||||
|
||||
InternalSearchHit hit3 = new InternalSearchHit(2, "_id3", new StringText("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
InternalSearchHit hit3 = new InternalSearchHit(2, "_id3", new Text("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
hit3.sourceRef(source);
|
||||
InternalSearchHit hit4 = new InternalSearchHit(3, "_id4", new StringText("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
InternalSearchHit hit4 = new InternalSearchHit(3, "_id4", new Text("type"), Collections.<String, SearchHitField>emptyMap());
|
||||
hit4.sourceRef(source);
|
||||
SearchResponse searchResponse2 = mockSearchResponse(1, 1, 2, hit3, hit4);
|
||||
SearchResponse searchResponse3 = mockSearchResponse(1, 1, 2);
|
||||
|
|
Loading…
Reference in New Issue