fix is_fast for bytes field

This commit is contained in:
Pascal Seitz
2022-04-20 12:02:38 +08:00
parent 6f4d203d1b
commit 6614a2cba0
2 changed files with 6 additions and 1 deletions
+4
View File
@@ -104,6 +104,10 @@ pub struct TermsAggregation {
/// Set the order. `String` is here a target, which is either "_count", "_key", or the name of
/// a metric sub_aggregation.
///
/// Single value metrics like average can be adressed by its name.
/// Multi value metrics like stats are required to adress their field by name e.g.
/// "stats.avg"
///
/// Examples in JSON format:
/// { "_count": "asc" }
/// { "_key": "asc" }
+2 -1
View File
@@ -188,13 +188,14 @@ impl FieldType {
/// returns true if the field is fast.
pub fn is_fast(&self) -> bool {
match *self {
FieldType::Bytes(ref bytes_options) => bytes_options.is_fast(),
FieldType::Str(ref text_options) => text_options.is_fast(),
FieldType::U64(ref int_options)
| FieldType::I64(ref int_options)
| FieldType::F64(ref int_options)
| FieldType::Date(ref int_options) => int_options.get_fastfield_cardinality().is_some(),
FieldType::Facet(_) => true,
_ => false,
FieldType::JsonObject(_) => false,
}
}