CompletionFieldMapper.Builder should make a copy of the default FieldType and set the builder field.

This commit is contained in:
Martijn van Groningen 2014-01-13 16:37:11 +01:00
parent 2c8baeaa4a
commit 2ea93a6ad9
1 changed files with 4 additions and 1 deletions

View File

@ -98,7 +98,8 @@ public class CompletionFieldMapper extends AbstractFieldMapper<String> {
private int maxInputLength = Defaults.DEFAULT_MAX_INPUT_LENGTH; private int maxInputLength = Defaults.DEFAULT_MAX_INPUT_LENGTH;
public Builder(String name) { public Builder(String name) {
super(name, Defaults.FIELD_TYPE); super(name, new FieldType(Defaults.FIELD_TYPE));
builder = this;
} }
public Builder payloads(boolean payloads) { public Builder payloads(boolean payloads) {
@ -299,6 +300,8 @@ public class CompletionFieldMapper extends AbstractFieldMapper<String> {
+ "] at position " + i + " is a reserved character"); + "] at position " + i + " is a reserved character");
} }
} }
System.out.println(names.indexName());
return new SuggestField(names.indexName(), input, this.fieldType, payload, analyzingSuggestLookupProvider); return new SuggestField(names.indexName(), input, this.fieldType, payload, analyzingSuggestLookupProvider);
} }