Add keyword type to index type system
Elasticsearch 5.0 introduced different ways to search strings: [1], either search whole values that we often refer to as keyword search, or individual tokens, that we usually refer to as full-text search. To reflect this change and support such fields in gerrit with ES 5 and higher, add keyword type to gerrit index type system. [1] https://www.elastic.co/blog/strings-are-dead-long-live-strings Change-Id: I25bd157cd638695f5a3b533463008fcf7da9ac8d
This commit is contained in:
committed by
David Pursehouse
parent
90db6de2e0
commit
506125e71a
@@ -337,7 +337,7 @@ public abstract class AbstractLuceneIndex<K, V> implements Index<K, V> {
|
||||
for (Object value : values.getValues()) {
|
||||
doc.add(new LongField(name, ((Timestamp) value).getTime(), store));
|
||||
}
|
||||
} else if (type == FieldType.EXACT || type == FieldType.PREFIX) {
|
||||
} else if (type == FieldType.KEYWORD || type == FieldType.EXACT || type == FieldType.PREFIX) {
|
||||
for (Object value : values.getValues()) {
|
||||
doc.add(new StringField(name, (String) value, store));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user