26
26
import java .util .Collection ;
27
27
import java .util .List ;
28
28
29
+ import static org .opensearch .indices .IndicesRequestCache .INDEX_CACHE_REQUEST_ENABLED_SETTING ;
29
30
import static org .opensearch .search .SearchService .CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING ;
30
31
import static org .opensearch .test .hamcrest .OpenSearchAssertions .assertAcked ;
31
32
import static org .opensearch .test .hamcrest .OpenSearchAssertions .assertSearchResponse ;
@@ -50,23 +51,25 @@ public void setupSuiteScopeCluster() throws Exception {
50
51
assertAcked (
51
52
prepareCreate (
52
53
"idx" ,
53
- Settings .builder ().put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 ).put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 )
54
+ Settings .builder ()
55
+ .put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 )
56
+ .put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 )
57
+ .put (INDEX_CACHE_REQUEST_ENABLED_SETTING .getKey (), false )
54
58
).setMapping ("type" , "type=keyword" , "num" , "type=integer" , "score" , "type=integer" )
55
59
);
56
60
waitForRelocation (ClusterHealthStatus .GREEN );
57
61
58
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "1" , "score" , "5" ).get ();
59
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "11" , "score" , "50" ).get ();
60
- refresh ("idx" );
61
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "1" , "score" , "2" ).get ();
62
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "12" , "score" , "20" ).get ();
63
- refresh ("idx" );
64
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "3" , "score" , "10" ).get ();
65
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "13" , "score" , "15" ).get ();
66
- refresh ("idx" );
67
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "3" , "score" , "1" ).get ();
68
- client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "13" , "score" , "100" ).get ();
69
- refresh ("idx" );
62
+ indexRandom (
63
+ true ,
64
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "1" , "score" , "5" ),
65
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "11" , "score" , "50" ),
66
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "1" , "score" , "2" ),
67
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "12" , "score" , "20" ),
68
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "3" , "score" , "10" ),
69
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "13" , "score" , "15" ),
70
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type1" , "num" , "3" , "score" , "1" ),
71
+ client ().prepareIndex ("idx" ).setId ("1" ).setSource ("type" , "type2" , "num" , "13" , "score" , "100" )
72
+ );
70
73
71
74
waitForRelocation (ClusterHealthStatus .GREEN );
72
75
refresh ();
0 commit comments