Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiOWI2ZmM3...
) / New Feature (
https://hibernate.atlassian.net/browse/HSEARCH-4806?atlOrigin=eyJpIjoiOWI...
) HSEARCH-4806 (
https://hibernate.atlassian.net/browse/HSEARCH-4806?atlOrigin=eyJpIjoiOWI...
) Basic support for parameters at the query level (
https://hibernate.atlassian.net/browse/HSEARCH-4806?atlOrigin=eyJpIjoiOWI...
)
Issue Type: New Feature Assignee: Unassigned Components: backend-elasticsearch,
backend-lucene, engine Created: 28/Feb/2023 00:50 AM Fix Versions: 7.x-backlog Priority:
Major Reporter: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
E.g. something like this:
List<MyProjection> searchSession.search(MyEntity.class)
.select(f -> f.distance( "location" ).fromParam( "center"
))
.where(f -> f.matchAll())
.param( "center" , someValue) // Parameter definition here
.fetchHits(20);
Or, more interestingly:
List<MyProjection> searchSession.search(MyEntity.class)
.select(MyProjection.class) // Consumes the parameter
.where(f -> f.matchAll())
.param( "center" , someValue) // Parameter definition here
.fetchHits(20);
This is necessary in order to support things like @DistanceProjection (see
https://hibernate.atlassian.net/browse/HSEARCH-4574 (
https://hibernate.atlassian.net/browse/HSEARCH-4574 ) ), where the projection itself is
defined at compile time, but obviously the location the distance is computed from is
defined at runtime (most likely from user input).
Let’s start with allowing to:
* define parameters when building a query
* use parameters in the distance projection
f.distance("location").fromParam("center")
* use parameters as the value to match in predicates: f ->
f.match().field("foo").matchingParam("foo") , f ->
f.terms().field("foo").matchingParamAny("foo") , etc.
(
https://hibernate.atlassian.net/browse/HSEARCH-4806#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4806#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#100217- sha1:65be9f2 )