Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PingXia-at committed Sep 7, 2023
1 parent 1526c3c commit 1ef7da4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/query/automaton_weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ use super::phrase_prefix_query::prefix_end;
pub struct AutomatonWeight<A> {
field: Field,
automaton: Arc<A>,
// This is specifically used for JSON fields.
// Context: For a JSON field, the term's value bytes include the JSON path, JSON path type, and the actual value bytes.
// When performing fuzzy or regex search on a JSON field's terms dictionary, it's essential to filter out terms that don't match the JSON path.
// Otherwise, a term might be mistakenly matched because of the JSON path, even if the actual value bytes don't match the search criteria.
// For JSON fields, the term dictionary include terms from all paths.
// We apply additional filtering based on the given JSON path, when searching within the term dictionary.
// This prevents terms from unrelated paths from matching the search criteria.
json_path_bytes: Option<Box<[u8]>>,
}

Expand Down

0 comments on commit 1ef7da4

Please sign in to comment.