File tree 1 file changed +7
-6
lines changed
server/src/test/java/org/elasticsearch/index/query
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -787,25 +787,27 @@ public void testEnabledPositionIncrements() throws Exception {
787
787
788
788
public void testToQueryFuzzyQueryAutoFuziness () throws Exception {
789
789
for (int i = 0 ; i < 3 ; i ++) {
790
+ final int len ;
790
791
final int expectedEdits ;
791
- String queryString ;
792
792
switch (i ) {
793
793
case 0 :
794
- queryString = randomAlphaOfLengthBetween (1 , 2 );
794
+ len = randomIntBetween (1 , 2 );
795
795
expectedEdits = 0 ;
796
796
break ;
797
797
798
798
case 1 :
799
- queryString = randomAlphaOfLengthBetween (3 , 5 );
799
+ len = randomIntBetween (3 , 5 );
800
800
expectedEdits = 1 ;
801
801
break ;
802
802
803
803
default :
804
- queryString = randomAlphaOfLengthBetween (6 , 20 );
804
+ len = randomIntBetween (6 , 20 );
805
805
expectedEdits = 2 ;
806
806
break ;
807
807
}
808
-
808
+ char [] bytes = new char [len ];
809
+ Arrays .fill (bytes , 'a' );
810
+ String queryString = new String (bytes );
809
811
for (int j = 0 ; j < 2 ; j ++) {
810
812
Query query = queryStringQuery (queryString + (j == 0 ? "~" : "~auto" ))
811
813
.defaultField (STRING_FIELD_NAME )
@@ -817,7 +819,6 @@ public void testToQueryFuzzyQueryAutoFuziness() throws Exception {
817
819
}
818
820
}
819
821
}
820
-
821
822
public void testFuzzyNumeric () throws Exception {
822
823
QueryStringQueryBuilder query = queryStringQuery ("12~1.0" ).defaultField (INT_FIELD_NAME );
823
824
QueryShardContext context = createShardContext ();
You can’t perform that action at this time.
0 commit comments