mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-31 15:31:53 +08:00
makes clippy and fmt happy
This commit is contained in:
parent
d92c173fdc
commit
376b3a19a7
@ -1051,7 +1051,7 @@ fn make_hits(
|
|||||||
formatter_builder.highlight_prefix(format.highlight_pre_tag);
|
formatter_builder.highlight_prefix(format.highlight_pre_tag);
|
||||||
formatter_builder.highlight_suffix(format.highlight_post_tag);
|
formatter_builder.highlight_suffix(format.highlight_post_tag);
|
||||||
let mut documents = Vec::new();
|
let mut documents = Vec::new();
|
||||||
let embedding_configs = index.embedding_configs(&rtxn)?;
|
let embedding_configs = index.embedding_configs(rtxn)?;
|
||||||
let documents_iter = index.documents(rtxn, documents_ids)?;
|
let documents_iter = index.documents(rtxn, documents_ids)?;
|
||||||
for ((id, obkv), score) in documents_iter.into_iter().zip(document_scores.into_iter()) {
|
for ((id, obkv), score) in documents_iter.into_iter().zip(document_scores.into_iter()) {
|
||||||
// First generate a document with all the displayed fields
|
// First generate a document with all the displayed fields
|
||||||
@ -1066,7 +1066,7 @@ fn make_hits(
|
|||||||
|
|
||||||
if retrieve_vectors {
|
if retrieve_vectors {
|
||||||
let mut vectors = serde_json::Map::new();
|
let mut vectors = serde_json::Map::new();
|
||||||
for (name, mut vector) in index.embeddings(&rtxn, id)? {
|
for (name, mut vector) in index.embeddings(rtxn, id)? {
|
||||||
let user_defined = embedding_configs
|
let user_defined = embedding_configs
|
||||||
.iter()
|
.iter()
|
||||||
.find(|conf| conf.name == name)
|
.find(|conf| conf.name == name)
|
||||||
@ -1079,7 +1079,7 @@ fn make_hits(
|
|||||||
} else {
|
} else {
|
||||||
embedding.insert("embedding".to_string(), vector.into());
|
embedding.insert("embedding".to_string(), vector.into());
|
||||||
}
|
}
|
||||||
vectors.insert(name.into(), embedding.into());
|
vectors.insert(name, embedding.into());
|
||||||
}
|
}
|
||||||
document.insert("_vectors".into(), vectors.into());
|
document.insert("_vectors".into(), vectors.into());
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,8 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{vector::parsed_vectors::RESERVED_VECTORS_FIELD_NAME, FieldId, FieldsIdsMap, Weight};
|
use crate::vector::parsed_vectors::RESERVED_VECTORS_FIELD_NAME;
|
||||||
|
use crate::{FieldId, FieldsIdsMap, Weight};
|
||||||
|
|
||||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||||
pub struct FieldidsWeightsMap {
|
pub struct FieldidsWeightsMap {
|
||||||
|
@ -656,7 +656,7 @@ pub(crate) fn write_typed_chunk_into_index(
|
|||||||
// typed chunks has always at least 1 chunk.
|
// typed chunks has always at least 1 chunk.
|
||||||
let Some((expected_dimension, embedder_name)) = params else { unreachable!() };
|
let Some((expected_dimension, embedder_name)) = params else { unreachable!() };
|
||||||
|
|
||||||
let mut embedding_configs = index.embedding_configs(&wtxn)?;
|
let mut embedding_configs = index.embedding_configs(wtxn)?;
|
||||||
let index_embedder_config = embedding_configs
|
let index_embedder_config = embedding_configs
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|IndexEmbeddingConfig { name, .. }| name == &embedder_name)
|
.find(|IndexEmbeddingConfig { name, .. }| name == &embedder_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user