Improve string field

This commit is contained in:
Andrea Cavalli 2022-06-04 19:18:51 +02:00
parent 0e9b45ebf9
commit 956f33fb6c

View File

@ -226,7 +226,13 @@ public class LLUtils {
case TextFieldStored -> new TextField(item.getName(), item.stringValue(), Store.YES);
case SortedNumericDocValuesField -> new SortedNumericDocValuesField(item.getName(), item.longData());
case NumericDocValuesField -> new NumericDocValuesField(item.getName(), item.longData());
case StringField -> new StringField(item.getName(), item.stringValue(), Store.NO);
case StringField -> {
if (item.getData() instanceof BytesRef bytesRef) {
yield new StringField(item.getName(), bytesRef, Store.NO);
} else {
yield new StringField(item.getName(), item.stringValue(), Store.NO);
}
}
case StringFieldStored -> {
if (item.getData() instanceof BytesRef bytesRef) {
yield new StringField(item.getName(), bytesRef, Store.YES);