Make facet indexation and storage optional

Added a FacetOptions for HierarchicalFacet which add indexed and stored flags to it.
Propagate change and update tests accordingly
Added a test to ensure that a not indexed flag was taken care of.
Added on Value implem the `path()` function to return the stored facet.
This commit is contained in:
Laurent Pouget
2021-03-22 21:01:39 +01:00
parent 5de9961cf2
commit 4b34231f28
20 changed files with 290 additions and 62 deletions

View File

@@ -23,7 +23,7 @@ fn main() -> tantivy::Result<()> {
let name = schema_builder.add_text_field("felin_name", TEXT | STORED);
// this is our faceted field: its scientific classification
let classification = schema_builder.add_facet_field("classification");
let classification = schema_builder.add_facet_field("classification", INDEXED);
let schema = schema_builder.build();
let index = Index::create_in_ram(schema);