Skip to content
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

Merged

Conversation

lpouget
Copy link

@lpouget lpouget commented Mar 23, 2021

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 implementation the path() function to return the stored facet.

Fixes #986

@lpouget lpouget force-pushed the facet-optional-storage-and-index branch 2 times, most recently from f413fb6 to 5df8166 Compare March 23, 2021 13:03
Copy link
Contributor

@fmassot fmassot left a 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

src/schema/field_entry.rs Outdated Show resolved Hide resolved
@lpouget
Copy link
Author

lpouget commented Mar 23, 2021

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.

@lpouget lpouget force-pushed the facet-optional-storage-and-index branch 2 times, most recently from 3afaf86 to 2b0d218 Compare March 23, 2021 20:10
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.
@lpouget lpouget force-pushed the facet-optional-storage-and-index branch from 2b0d218 to 4b34231 Compare March 24, 2021 13:56
Copy link
Contributor

@fmassot fmassot left a 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!(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@fulmicoton fulmicoton merged commit 1557290 into quickwit-oss:main Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Facet being stored should be optional
3 participants