Skip to content

Commit

Permalink
fixup! squash! fixup! fix: correct JSON field check logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
LebranceBW committed Nov 19, 2024
1 parent 97d7958 commit a60ff6e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/query/query_parser/query_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,18 @@ impl QueryParser {
let field_type = field_entry.field_type();
if !field_type.is_fast() {
// FIXME: FieldNotIndexed error is not accurate.
return (None, vec![QueryParserError::FieldNotIndexed(
field_entry.name().to_string(),
)]);
return (
None,
vec![QueryParserError::FieldNotIndexed(
field_entry.name().to_string(),
)],
);
}
if json_path.is_empty() == field_type.is_json() {
let error = if field_type.is_json() {
QueryParserError::UnsupportedQuery(format!(
"JSON path must be provided when querying the existence of a JSON field: {}",
"JSON path must be provided when querying the existence of a JSON \
field: {}",
field_entry.name()
))
} else {
Expand Down

0 comments on commit a60ff6e

Please sign in to comment.