Fix boolean coercion from numeric values for wildcard index queries (#5269)#5293
Fix boolean coercion from numeric values for wildcard index queries (#5269)#5293qianheng-aws wants to merge 2 commits intoopensearch-project:mainfrom
Conversation
…pensearch-project#5269) When querying across indices with conflicting field mappings (boolean vs text), numeric values like 0 were not coerced to boolean, causing "node must be a boolean, found NUMBER" error. Added numeric handling to parseBooleanValue() consistent with ObjectContent.booleanValue(). Signed-off-by: Qianheng Chen <chenqiah@amazon.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Heng Qian <qianheng@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 614bd7d)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 614bd7d
Previous suggestionsSuggestions up to commit d237222
|
|
Persistent review updated to latest commit 614bd7d |
Description
[BugFix] When querying across indices with conflicting field mappings (boolean vs text) using wildcard patterns like
source = repro*, numeric values such as0stored in the text-typed index were not coerced to boolean, causingOpenSearchParseException: node must be a boolean, found NUMBER.Root cause:
OpenSearchJsonContent.parseBooleanValue()only handledisBoolean()andisTextual()nodes but not numeric nodes. AddedisNumber()handling consistent withObjectContent.booleanValue()which already does((Number) value).intValue() != 0.Related Issues
Resolves #5269
Check List
-s)spotlessCheckpassed.g4files synced (if applicable)