diff --git a/crates/milli/src/vector/rest.rs b/crates/milli/src/vector/rest.rs index 9477959ad..41e8ca9f9 100644 --- a/crates/milli/src/vector/rest.rs +++ b/crates/milli/src/vector/rest.rs @@ -561,6 +561,7 @@ impl Request { Err(error) => { let message = error.error_message("request", REQUEST_PLACEHOLDER, REPEAT_PLACEHOLDER); + let message = format!("{message}\n - Note: this template is using a document template, and so expects to contain the placeholder {REQUEST_PLACEHOLDER:?} rather than {REQUEST_FRAGMENT_PLACEHOLDER:?}"); return Err(NewEmbedderError::rest_could_not_parse_template(message)); } }; @@ -592,15 +593,23 @@ impl RequestFromFragments { request: Value, search_fragments: impl IntoIterator, ) -> Result { - let request = - match InjectableValue::new(request, REQUEST_FRAGMENT_PLACEHOLDER, REPEAT_PLACEHOLDER) { - Ok(template) => template, - Err(error) => { - let message = - error.error_message("request", REQUEST_PLACEHOLDER, REPEAT_PLACEHOLDER); - return Err(NewEmbedderError::rest_could_not_parse_template(message)); - } - }; + let request = match InjectableValue::new( + request, + REQUEST_FRAGMENT_PLACEHOLDER, + REPEAT_PLACEHOLDER, + ) { + Ok(template) => template, + Err(error) => { + let message = error.error_message( + "request", + REQUEST_FRAGMENT_PLACEHOLDER, + REPEAT_PLACEHOLDER, + ); + let message = format!("{message}\n - Note: this template is using fragments, and so expects to contain the placeholder {REQUEST_FRAGMENT_PLACEHOLDER:?} rathern than {REQUEST_PLACEHOLDER:?}"); + + return Err(NewEmbedderError::rest_could_not_parse_template(message)); + } + }; let search_fragments: Result<_, NewEmbedderError> = search_fragments .into_iter()