Rename the SearchForFacetValues struct

This commit is contained in:
Clément Renault 2023-04-27 10:43:02 +02:00 committed by Louis Dureuil
parent aadbe88048
commit 55c17aa38b
No known key found for this signature in database
3 changed files with 9 additions and 8 deletions

View file

@ -58,7 +58,7 @@ pub use self::heed_codec::{
pub use self::index::Index;
pub use self::search::{
FacetDistribution, FacetValueHit, Filter, FormatOptions, MatchBounds, MatcherBuilder,
MatchingWords, Search, SearchForFacetValue, SearchResult, TermsMatchingStrategy,
MatchingWords, Search, SearchForFacetValues, SearchResult, TermsMatchingStrategy,
DEFAULT_VALUES_PER_FACET,
};

View file

@ -13,7 +13,8 @@ use crate::error::UserError;
use crate::heed_codec::facet::{FacetGroupKey, FacetGroupValue};
use crate::score_details::{ScoreDetails, ScoringStrategy};
use crate::{
execute_search, AscDesc, DefaultSearchLogger, DocumentId, Index, Result, SearchContext, BEU16,
execute_search, AscDesc, DefaultSearchLogger, DocumentId, FieldIdMapMissingEntry, Index,
Result, SearchContext, BEU16,
};
// Building these factories is not free.
@ -241,15 +242,15 @@ pub fn build_dfa(word: &str, typos: u8, is_prefix: bool) -> DFA {
}
}
pub struct SearchForFacetValue<'a> {
pub struct SearchForFacetValues<'a> {
query: Option<String>,
facet: String,
search_query: Search<'a>,
}
impl<'a> SearchForFacetValue<'a> {
pub fn new(facet: String, search_query: Search<'a>) -> SearchForFacetValue<'a> {
SearchForFacetValue { query: None, facet, search_query }
impl<'a> SearchForFacetValues<'a> {
pub fn new(facet: String, search_query: Search<'a>) -> SearchForFacetValues<'a> {
SearchForFacetValues { query: None, facet, search_query }
}
pub fn query(&mut self, query: impl Into<String>) -> &mut Self {