Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiZDIwNzA5...
) / New Feature (
https://hibernate.atlassian.net/browse/HSEARCH-4542?atlOrigin=eyJpIjoiZDI...
) HSEARCH-4542 (
https://hibernate.atlassian.net/browse/HSEARCH-4542?atlOrigin=eyJpIjoiZDI...
).within() and .withinAny() for the range predicate (
https://hibernate.atlassian.net/browse/HSEARCH-4542?atlOrigin=eyJpIjoiZDI...
)
Change By: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
When doing range faceting, it’s sometimes useful to match documents for which a given
field is within one of multiple ranges.
The current syntax is a bit cumbersome:
{noformat}f -> f.bool(b -> {
for (Range<Integer> range : rangesToMatch) {
b.should(f.range().field("myField").range(range))
}
}){noformat}
Let’s introduce a syntax that will accept multiple ranges, and create the underlying
boolean query transparently:
{noformat}f -> f.range().field("myField").withinAny(rangesToMatch){noformat}
I think {{withinAny}} would be a better name for this method than {{ranges}}, because a
trailing {{s}} is easily overlooked. Also,
{{f.range().field("myField").ranges(...)}} is really far from natural language.
For consistency, we should add a {{ withinRange within }} method to replace the {{range}}
method, and deprecate the {{range}} method.
(
https://hibernate.atlassian.net/browse/HSEARCH-4542#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4542#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:ee9e30a )