Repository navigation
fix(search): answer text on numeric and date fields the same on both engines - #4122
Merged
Merged
Conversation
…engines A text restriction on a numeric field reached the engines as is. bleve found nothing for size:>100 or size:50..500, OpenSearch failed the search with a number format exception. size=50 only matched on OpenSearch. Both engines now read the value of such a restriction as a number and match it as a whole, with : and with =. Anything that is no number matches nothing, and so does text on a date field. size:>100 is not KQL, the range form is size>100; old iOS clients still send the colon form. The field type comes from one table of all fields, built from the walk the mapping validation uses. It replaces the separate walk for numeric fields, which left out the parts of a location: location.altitude>1000 now matches, the parts are indexed as numbers next to the geopoint. The parity suite covers >=, <=, combined ranges, number equality, the colon forms and the location parts.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 10 |
🟢 Coverage 82.14% diff coverage · +0.04% coverage variation
Metric Results Coverage variation ✅ +0.04% coverage variation (-1.00%) Diff coverage ✅ 82.14% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (9ebb6a7) 95214 29578 31.06% Head commit (c3a08d8) 95231 (+17) 29617 (+39) 31.10% (+0.04%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4122) 56 46 82.14% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
fschade
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A text value on a numeric or date field now gets the same answer from bleve and OpenSearch.
Before,
size:>100andsize:50..500found nothing on bleve and failed the whole search on OpenSearch with a number format exception.size=50only matched on OpenSearch. Old iOS clients still send the colon formsize:>100.:and with=(size:50,size=50,audio.duration:200).size:>100,size:50..500,size:5*,audio.duration:long), and so does text on a date field (mtime:>2021-01-01)...stays unsupported, it now answers with no match instead of an error.FieldIsNumericand the newFieldIsDatetimeread from one table of field types, built from the walk the mapping validation already uses. That replacesmapping.NumericFieldsfrom #4096.One behaviour change comes with that: the parts of a location count as numeric fields, so
location.altitude>1000matches. They are indexed as numbers next to the geopoint in both engines, the previous walk skipped them.The parity suite covers
>=,<=, combined ranges, number equality, the colon forms and the location parts.