| Original |
|---|
1 public Field getCompletionField(ContextMapping.Context ctx,
2 String input, BytesRef payload) {
3 final String originalInput = input;
4 if (input.length() > maxInputLength) {
5 final int len = correctSubStringLen(input,
6 Math.min(maxInputLength, input.length()));
7 input = input.substring(0, len);
8 }
9 for (int i = 0; i < input.length(); i++) {
10 if (isReservedChar(input.charAt(i))) {
11 throw new IllegalArgumentException("Illegal input ["
12 + originalInput + "] UTF-16 codepoint [0x"
13 + Integer.toHexString((int) input.charAt(i))
14 .toUpperCase(Locale.ROOT)
15 + "] at position " + i + " is a reserved character");
16 }
17 }
18 return new SuggestField(fieldType.names().indexName(),
19 ctx, input, this.fieldType, payload,
20 fieldType().analyzingSuggestLookupProvider);
21 }
22
|
| | Modified |
|---|
1 public Field getCompletionField(ContextMapping.Context ctx,
2 String input, BytesRef payload) {
3 final String originalInput = input;
4 if (input.length() > maxInputLength) {
5 final int len = correctSubStringLen(input,
6 Math.min(maxInputLength, input.length()));
7 input = input.substring(0, len);
8 }
9 for (int i = 0; i < input.length(); i++) {
10 if (isReservedChar(input.charAt(i))) {
11 throw new IllegalArgumentException("Illegal input ["
12 + originalInput + "] UTF-16 codepoint [0x"
13 + Integer.toHexString((int) input.charAt(i))
14 .toUpperCase(Locale.ROOT)
15 + "] at position " + i + " is a reserved character");
16 }
17 }
18 return new SuggestField(fieldType().names().indexName(),
19 ctx, input, fieldType(), payload,
20 fieldType().analyzingSuggestLookupProvider);
21 }
22
|
|