[hibernate-issues] [JIRA] (HSEARCH-3325) Search 6 groundwork - Restore support for full-text filters

Yoann Rodière (JIRA) jira at hibernate.atlassian.net
Wed Mar 11 04:05:16 EDT 2020


Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b ) *commented* on HSEARCH-3325 ( https://hibernate.atlassian.net/browse/HSEARCH-3325?atlOrigin=eyJpIjoiODE0NTUxYzY4NDZmNGRhZmExZWM2ZGNhNGRmMTM3ZDAiLCJwIjoiaiJ9 )

Re: Search 6 groundwork - Restore support for full-text filters ( https://hibernate.atlassian.net/browse/HSEARCH-3325?atlOrigin=eyJpIjoiODE0NTUxYzY4NDZmNGRhZmExZWM2ZGNhNGRmMTM3ZDAiLCJwIjoiaiJ9 )

Hello Waldemar Kłaczyński ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A77e50cac-bda3-4af4-9bb3-6461f4d10eea ).

Your design submitted on HSEARCH-3862 ( https://hibernate.atlassian.net/browse/HSEARCH-3862 ) Closed seems sound, but there are a few details to discuss. If you intend to submit a pull request, please hold until we agree on those details.

First, I'm a bit sceptical as to the usefulness of that feature now that we allow predicates to be defined as lambdas.

With the * *current API* *, you could do this:

public static class TestFilter {
	public static SearchPredicate filter(SearchPredicateFactory f, boolean match) {
		f.filter( f -> f..match().field( "fieldName" )
			.matching( match )
			.toPredicate;
	}
}

	scope.query()
	.where( f -> f.bool()
		.filter( TestFilter.filter( f, true ) )
		.must( ... )
	)
	.toQuery()

This achieves the same result as your original proposal, without requiring any additional API, and guarantees type safety for the match param. Could you point out what the disadvantages of this solution are?

( https://hibernate.atlassian.net/browse/HSEARCH-3325#add-comment?atlOrigin=eyJpIjoiODE0NTUxYzY4NDZmNGRhZmExZWM2ZGNhNGRmMTM3ZDAiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-3325#add-comment?atlOrigin=eyJpIjoiODE0NTUxYzY4NDZmNGRhZmExZWM2ZGNhNGRmMTM3ZDAiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121- sha1:ecfcbe7 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200311/9c49aa21/attachment.html 


More information about the hibernate-issues mailing list