diff --git a/src/indexer/json_term_writer.rs b/src/indexer/json_term_writer.rs index 6e54cb6c8..503fc69a1 100644 --- a/src/indexer/json_term_writer.rs +++ b/src/indexer/json_term_writer.rs @@ -257,8 +257,11 @@ pub struct JsonTermWriter<'a> { } impl<'a> JsonTermWriter<'a> { - // Prepares writing terms for a given field - pub fn initialize(field: Field, json_path: &str, term_buffer: &'a mut Term) -> Self { + pub fn from_field_and_json_path( + field: Field, + json_path: &str, + term_buffer: &'a mut Term, + ) -> Self { term_buffer.set_field(Type::Json, field); let mut json_term_writer = Self::wrap(term_buffer); for segment in json_path.split('.') { diff --git a/src/query/query_parser/query_parser.rs b/src/query/query_parser/query_parser.rs index 2ce07983f..1f2478af5 100644 --- a/src/query/query_parser/query_parser.rs +++ b/src/query/query_parser/query_parser.rs @@ -672,7 +672,8 @@ fn generate_literals_for_json_object( ) -> Result, QueryParserError> { let mut logical_literals = Vec::new(); let mut term = Term::new(); - let mut json_term_writer = JsonTermWriter::initialize(field, json_path, &mut term); + let mut json_term_writer = + JsonTermWriter::from_field_and_json_path(field, json_path, &mut term); if let Some(term) = convert_to_fast_value_and_get_term(&mut json_term_writer, phrase) { logical_literals.push(LogicalLiteral::Term(term)); }