mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
Add TODOs
This commit is contained in:
parent
a4536b1381
commit
9991152bbe
@ -90,6 +90,7 @@ pub struct SearchQuery {
|
|||||||
#[derive(Debug, Clone, Default, PartialEq, Deserr)]
|
#[derive(Debug, Clone, Default, PartialEq, Deserr)]
|
||||||
#[deserr(error = DeserrJsonError<InvalidHybridQuery>, rename_all = camelCase, deny_unknown_fields)]
|
#[deserr(error = DeserrJsonError<InvalidHybridQuery>, rename_all = camelCase, deny_unknown_fields)]
|
||||||
pub struct HybridQuery {
|
pub struct HybridQuery {
|
||||||
|
/// TODO validate that sementic ratio is between 0.0 and 1,0
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidSemanticRatio>, default = DEFAULT_SEMANTIC_RATIO())]
|
#[deserr(default, error = DeserrJsonError<InvalidSemanticRatio>, default = DEFAULT_SEMANTIC_RATIO())]
|
||||||
pub semantic_ratio: f32,
|
pub semantic_ratio: f32,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidEmbedder>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidEmbedder>, default)]
|
||||||
@ -452,6 +453,9 @@ pub fn perform_search(
|
|||||||
let (search, is_finite_pagination, max_total_hits, offset) =
|
let (search, is_finite_pagination, max_total_hits, offset) =
|
||||||
prepare_search(index, &rtxn, &query, features)?;
|
prepare_search(index, &rtxn, &query, features)?;
|
||||||
|
|
||||||
|
/// TODO: Change if-cond to query.hybrid.is_some
|
||||||
|
/// + < 1.0 or remove q
|
||||||
|
/// + > 0.0 or remove vector
|
||||||
let milli::SearchResult { documents_ids, matching_words, candidates, document_scores, .. } =
|
let milli::SearchResult { documents_ids, matching_words, candidates, document_scores, .. } =
|
||||||
if query.q.is_some() && query.vector.is_some() {
|
if query.q.is_some() && query.vector.is_some() {
|
||||||
search.execute_hybrid()?
|
search.execute_hybrid()?
|
||||||
|
@ -252,6 +252,7 @@ impl<'a> Search<'a> {
|
|||||||
// can unwrap because we returned already if there was no vector query
|
// can unwrap because we returned already if there was no vector query
|
||||||
self.vector_results_for_keyword(search.vector.as_ref().unwrap(), &keyword_results)?;
|
self.vector_results_for_keyword(search.vector.as_ref().unwrap(), &keyword_results)?;
|
||||||
|
|
||||||
|
/// TODO apply sementic ratio
|
||||||
let keyword_results =
|
let keyword_results =
|
||||||
CombinedSearchResult::new(keyword_results, vector_results_for_keyword);
|
CombinedSearchResult::new(keyword_results, vector_results_for_keyword);
|
||||||
let vector_results = CombinedSearchResult::new(vector_results, keyword_results_for_vector);
|
let vector_results = CombinedSearchResult::new(vector_results, keyword_results_for_vector);
|
||||||
|
@ -50,6 +50,7 @@ pub struct Search<'a> {
|
|||||||
scoring_strategy: ScoringStrategy,
|
scoring_strategy: ScoringStrategy,
|
||||||
words_limit: usize,
|
words_limit: usize,
|
||||||
exhaustive_number_hits: bool,
|
exhaustive_number_hits: bool,
|
||||||
|
/// TODO: Add semantic ratio or pass it directly to execute_hybrid()
|
||||||
rtxn: &'a heed::RoTxn<'a>,
|
rtxn: &'a heed::RoTxn<'a>,
|
||||||
index: &'a Index,
|
index: &'a Index,
|
||||||
distribution_shift: Option<DistributionShift>,
|
distribution_shift: Option<DistributionShift>,
|
||||||
|
Loading…
Reference in New Issue
Block a user