diff --git a/internal/core/thirdparty/tantivy/tantivy-binding/src/tokenizer.rs b/internal/core/thirdparty/tantivy/tantivy-binding/src/tokenizer.rs index 1630381511..b910774a2e 100644 --- a/internal/core/thirdparty/tantivy/tantivy-binding/src/tokenizer.rs +++ b/internal/core/thirdparty/tantivy/tantivy-binding/src/tokenizer.rs @@ -87,10 +87,12 @@ impl AnalyzerBuilder<'_> { } } - fn get_tokenizer_name(&self) -> Result { - let tokenizer = self.params.get("tokenizer"); - if tokenizer.is_none() { - return Ok("standard".to_string()); + fn get_tokenizer_name(&self) -> Result{ + let tokenizer=self.params.get("tokenizer"); + if tokenizer.is_none(){ + return Err(TantivyBindingError::InternalError(format!( + "tokenizer name or type must be set" + ))); } if !tokenizer.unwrap().is_string() { return Err(TantivyBindingError::InternalError(format!( @@ -257,8 +259,14 @@ pub(crate) fn create_tokenizer_with_filter(params: &String) -> Result Result { #[cfg(test)] mod tests { use crate::tokenizer::create_tokenizer; - use regex; #[test] fn test_standard_analyzer() {