mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-10-28 14:36:32 +00:00
fix is_fast for bytes field
This commit is contained in:
@@ -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" }
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user