Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
PSeitz committed Nov 13, 2023
1 parent b53c48b commit 982bc22
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/core/json_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ fn index_json_value<'a, V: Value<'a>>(
/// Tries to infer a JSON type from a string and append it to the term.
///
/// The term must be json + JSON path.
pub(crate) fn convert_to_fast_value_and_append(mut term: Term, phrase: &str) -> Option<Term> {
pub(crate) fn convert_to_fast_value_and_append_to_json_term(
mut term: Term,
phrase: &str,
) -> Option<Term> {
assert_eq!(
term.value()
.as_json_value_bytes()
Expand Down
7 changes: 5 additions & 2 deletions src/query/query_parser/query_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use rustc_hash::FxHashMap;

use super::logical_ast::*;
use crate::core::Index;
use crate::json_utils::{convert_to_fast_value_and_append, split_json_path, term_from_json_paths};
use crate::json_utils::{
convert_to_fast_value_and_append_to_json_term, split_json_path, term_from_json_paths,
};
use crate::query::range_query::{is_type_valid_for_fastfield_range_query, RangeQuery};
use crate::query::{
AllQuery, BooleanQuery, BoostQuery, EmptyQuery, FuzzyTermQuery, Occur, PhrasePrefixQuery,
Expand Down Expand Up @@ -974,7 +976,8 @@ fn generate_literals_for_json_object(
};

// Try to convert the phrase to a fast value
if let Some(term) = convert_to_fast_value_and_append(get_term_with_path(), phrase) {
if let Some(term) = convert_to_fast_value_and_append_to_json_term(get_term_with_path(), phrase)
{
logical_literals.push(LogicalLiteral::Term(term));
}

Expand Down

0 comments on commit 982bc22

Please sign in to comment.