-
-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make facet indexation and storage optional #996
Make facet indexation and storage optional #996
Conversation
f413fb6
to
5df8166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR seems good, I still need to understand the tests test_facet_not_populated_for_any_docs / test_facet_not_indexed_for_all_docs, not sure what is the goal here
The goal here was to be able to ensure presence of the doc in the store even if it's not indexed (and by extension check it's not indexed). But maybe it's not the best place to do this. |
3afaf86
to
2b0d218
Compare
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.
2b0d218
to
4b34231
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fulmicoton I'm ok with the PR. I'm just a little bit annoyed by the verbosity of tests but it's probably better to handle that in another issue.
@@ -108,19 +108,22 @@ impl SegmentReader { | |||
/// Accessor to the `FacetReader` associated to a given `Field`. | |||
pub fn facet_reader(&self, field: Field) -> crate::Result<FacetReader> { | |||
let field_entry = self.schema.get_field_entry(field); | |||
if field_entry.field_type() != &FieldType::HierarchicalFacet { | |||
return Err(crate::TantivyError::InvalidArgument(format!( | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Added a
FacetOptions
forHierarchicalFacet
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
implementation thepath()
function to return the stored facet.Fixes #986