Skip to content

Commit

Permalink
fix: correct JSON field check logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
LebranceBW committed Nov 18, 2024
1 parent ec5a3a2 commit 17cb58a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/query/query_parser/query_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,14 +855,17 @@ impl QueryParser {
.ok_or_else(|| QueryParserError::FieldDoesNotExist(full_path.clone())));
let field_entry = self.schema.get_field_entry(field);
let field_type = field_entry.field_type();
// `ExistsQuery` currently supports only FAST fields.
if !field_type.is_fast() {
// FIXME: FieldNotIndexed error is not accurate.
errors.push(QueryParserError::FieldNotIndexed(
field_entry.name().to_string(),
));
return (None, errors);
}
if !json_path.is_empty() && field_type.is_json() {
// Though JSON fields cannot be FAST fields, `split_full_path`
// may still return a FAST field with a non-empty JSON path.
if !json_path.is_empty() {
errors.push(QueryParserError::UnsupportedQuery(format!(
"Json path is not supported for field {:?}",
field_entry.name()
Expand Down

0 comments on commit 17cb58a

Please sign in to comment.