mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 08:41:00 +00:00
Prevent having both a fragment name and userProvided
This commit is contained in:
@ -25,7 +25,6 @@ impl<'a> VectorFilter<'a> {
|
||||
/// - `_vectors.{embedder_name}`
|
||||
/// - `_vectors.{embedder_name}.userProvided`
|
||||
/// - `_vectors.{embedder_name}.fragments.{fragment_name}`
|
||||
/// - `_vectors.{embedder_name}.fragments.{fragment_name}.userProvided`
|
||||
pub(super) fn parse(s: &'a str) -> Result<Self> {
|
||||
let mut split = s.split('.').peekable();
|
||||
|
||||
@ -54,6 +53,12 @@ impl<'a> VectorFilter<'a> {
|
||||
user_provided = true;
|
||||
}
|
||||
|
||||
if fragment_name.is_some() && user_provided {
|
||||
return Err(Error::UserError(UserError::InvalidFilter(
|
||||
String::from("Vector filter cannot specify both a fragment name and userProvided"),
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(next) = split.next() {
|
||||
return Err(Error::UserError(UserError::InvalidFilter(format!(
|
||||
"Unexpected part in vector filter: '{next}'"
|
||||
|
Reference in New Issue
Block a user