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

Waldemar Kłaczyński (JIRA) jira at hibernate.atlassian.net
Wed Mar 11 11:48:59 EDT 2020


Waldemar Kłaczyński ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A77e50cac-bda3-4af4-9bb3-6461f4d10eea ) *commented* on HSEARCH-3325 ( https://hibernate.atlassian.net/browse/HSEARCH-3325?atlOrigin=eyJpIjoiMjk3NTU1ZTM2YzkyNDNiYWFmZDY3MDVmYjE3MTQ4MmYiLCJwIjoiaiJ9 )

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

Of course, also from previous versions, the definition of native filters was just an addition, the same could always be obtained by the query itself. In the previous version, you could also make an external library containing static methods that return ready-made filters. However, assigning a filter to an object type greatly simplifies management, especially at work where many people do programming. For large projects, this is very useful for improving the readability of the code.

Previously, there was a similar solution in version 5.4.

   public static class TestFilter {

       public static Query filter( String match) {
           return IntPoint.newExactQuery( "fieldName" , match );
       }
   }

    FullTextQuery fullTextQuery = fullTextEntityManager
             .createFullTextQuery( new BooleanQuery.Builder()
                     .add(TestFilter.filter( "blablabla" ), BooleanClause.Occur.FILTER),
                     Assortment.class);

But such filters made it easier to organize the code. I think it's easy to reproduce in version 6.x. I will try to give a ready solution.

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

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/dce1dae0/attachment.html 


More information about the hibernate-issues mailing list