Fixed
Status Update
Comments
rb...@google.com <rb...@google.com> #2
Thank you for bringing this to our attention. I have forwarded your report to the engineering team and any questions they have will be posted here. Further status updates will be posted here as well.
[Deleted User] <[Deleted User]> #3
This resolved in 1.9.28 or 1.9.29 didn't it? If so issue here should close.
js...@google.com <js...@google.com> #4
This issue is being closed as all blocking work is complete. The issue has likely been resolved for a while, however thanks to the recent integration with our internal tracker we can more easily detect cases with no remaining blockers.
If this issue is not actually resolved, please open a new issue which references this one and we'll take a look.
If this issue is not actually resolved, please open a new issue which references this one and we'll take a look.
Description
index.search('my_field < "2"')
Where my_field is an IntegerField, if I have 2 documents indexed, one with my_field=1 and one with my_field=3, this only returns the first.
But in local dev with SDK >= 1.9.22 this throws an error:
InvalidRequest: Unable to compare "my_field" with "2"
I appreciate inequalities are only designed to work with numbers and dates, but the production implementation clearly coerces "2" to a number before comparing, while the search stub in the SDK does not. They should be consistent where possible.
The stub matches production behaviour if numbers are left unquoted.
Some digging shows that this is caused by recent changes to `_CheckMatch` in google/appengine/api/search/stub/document_matcher.py, specifically the attempted coercion to `float()` on L503, which doesn’t allow for quoted values.