Make sure that we generate the faceted database when required

This commit is contained in:
Kerollmops 2021-06-01 16:29:14 +02:00
parent b0c0490e85
commit 3c304c89d4
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
5 changed files with 135 additions and 42 deletions

View file

@ -79,7 +79,7 @@ mod test {
// set distinct and faceted attributes for the index.
let builder = UpdateBuilder::new(0);
let mut update = builder.settings(&mut txn, &index);
update.set_distinct_attribute(distinct.to_string());
update.set_distinct_field(distinct.to_string());
update.execute(|_, _| ()).unwrap();
// add documents to the index

View file

@ -136,7 +136,7 @@ impl<'a> Search<'a> {
let criteria_builder = criteria::CriteriaBuilder::new(self.rtxn, self.index)?;
let criteria = criteria_builder.build(query_tree, primitive_query, filtered_candidates)?;
match self.index.distinct_attribute(self.rtxn)? {
match self.index.distinct_field(self.rtxn)? {
None => self.perform_sort(NoopDistinct, matching_words, criteria),
Some(name) => {
let field_ids_map = self.index.fields_ids_map(self.rtxn)?;