caio.co/de/cantine

Revert "Make float fields FAST too"

This reverts commit 59e03d738ebda6c5ef1702adca19e2a44c97b301.
Id
9c7e670f792ace1a86f61d86358a649946970526
Author
Caio
Commit time
2019-12-12T08:22:58+01:00

Modified crates/cantine_derive/src/lib.rs

@@ -154,8 +154,14
FieldType::FLOAT => quote!(add_f64_field),
};

- quote_spanned! { field.span()=>
- #name: builder.#method(#quoted, tantivy::schema::INDEXED | tantivy::schema::FAST)
+ match field_type {
+ // FIXME tantivy 0.11+
+ FieldType::FLOAT => quote_spanned! { field.span()=>
+ #name: builder.#method(#quoted, tantivy::schema::INDEXED)
+ },
+ _ => quote_spanned! { field.span()=>
+ #name: builder.#method(#quoted, tantivy::schema::INDEXED | tantivy::schema::FAST)
+ },
}
});

@@ -279,6 +285,7
}

impl std::convert::TryFrom<&tantivy::schema::Schema> for #index_name {
+ // TODO better errors
type Error = tantivy::TantivyError;

fn try_from(schema: &tantivy::schema::Schema) -> std::result::Result<Self, Self::Error> {