Class PgFullTextSearchFunction.Filter

  • All Implemented Interfaces:
    org.hibernate.dialect.function.SQLFunction
    Enclosing class:
    PgFullTextSearchFunction

    public static class PgFullTextSearchFunction.Filter
    extends PgFullTextSearchFunction
    It allows to add a where clause to filter by those values that fit the search. In order for this to work there needs to be a column stored in the database that contains a tsvector built with the columns for which the search is required.

    Examples of usage having p as alias of a product table and searchable_field as the tsvector field:

    - 'and fullTextSearchFilter(p, p.searchable_field, 'english', 'cat')' this will search for any field that has any word having to do with cat

    - 'and fullTextSearchFilter(p, p.searchable_field, 'english', 'cat:* | black:*')' this will search for any field that has any word having to do with cat or black and that starts at least by cat or black