Make sure KeywordFieldMapper#clone preserves split_queries_on_whitespace. (#31049)
This commit is contained in:
parent
7e565797e7
commit
30a8f9d948
|
@ -198,7 +198,7 @@ public final class KeywordFieldMapper extends FieldMapper {
|
|||
protected KeywordFieldType(KeywordFieldType ref) {
|
||||
super(ref);
|
||||
this.normalizer = ref.normalizer;
|
||||
this.splitQueriesOnWhitespace = splitQueriesOnWhitespace;
|
||||
this.splitQueriesOnWhitespace = ref.splitQueriesOnWhitespace;
|
||||
}
|
||||
|
||||
public KeywordFieldType clone() {
|
||||
|
|
|
@ -52,8 +52,15 @@ public class KeywordFieldTypeTests extends FieldTypeTestCase {
|
|||
public void setupProperties() {
|
||||
addModifier(new Modifier("normalizer", false) {
|
||||
@Override
|
||||
public void modify(MappedFieldType ft) {
|
||||
((KeywordFieldType) ft).setNormalizer(Lucene.KEYWORD_ANALYZER);
|
||||
public void modify(MappedFieldType type) {
|
||||
((KeywordFieldType) type).setNormalizer(Lucene.KEYWORD_ANALYZER);
|
||||
}
|
||||
});
|
||||
addModifier(new Modifier("split_queries_on_whitespace", true) {
|
||||
@Override
|
||||
public void modify(MappedFieldType type) {
|
||||
KeywordFieldType keywordType = (KeywordFieldType) type;
|
||||
keywordType.setSplitQueriesOnWhitespace(!keywordType.splitQueriesOnWhitespace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue