mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-23 02:29:57 +00:00
add json path constructor to term (#2367)
This commit is contained in:
@@ -11,9 +11,7 @@ use rustc_hash::FxHashMap;
|
||||
|
||||
use super::logical_ast::*;
|
||||
use crate::index::Index;
|
||||
use crate::json_utils::{
|
||||
convert_to_fast_value_and_append_to_json_term, split_json_path, term_from_json_paths,
|
||||
};
|
||||
use crate::json_utils::convert_to_fast_value_and_append_to_json_term;
|
||||
use crate::query::range_query::{is_type_valid_for_fastfield_range_query, RangeQuery};
|
||||
use crate::query::{
|
||||
AllQuery, BooleanQuery, BoostQuery, EmptyQuery, FuzzyTermQuery, Occur, PhrasePrefixQuery,
|
||||
@@ -966,14 +964,8 @@ fn generate_literals_for_json_object(
|
||||
let index_record_option = text_options.index_option();
|
||||
let mut logical_literals = Vec::new();
|
||||
|
||||
let paths = split_json_path(json_path);
|
||||
let get_term_with_path = || {
|
||||
term_from_json_paths(
|
||||
field,
|
||||
paths.iter().map(|el| el.as_str()),
|
||||
json_options.is_expand_dots_enabled(),
|
||||
)
|
||||
};
|
||||
let get_term_with_path =
|
||||
|| Term::from_field_json_path(field, json_path, json_options.is_expand_dots_enabled());
|
||||
|
||||
// Try to convert the phrase to a fast value
|
||||
if let Some(term) = convert_to_fast_value_and_append_to_json_term(get_term_with_path(), phrase)
|
||||
|
||||
Reference in New Issue
Block a user