Package org.openbravo.client.kernel
Class PgFullTextSearchFunction.Filter
- java.lang.Object
-
- org.openbravo.client.kernel.PgFullTextSearchFunction
-
- org.openbravo.client.kernel.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbravo.client.kernel.PgFullTextSearchFunction
PgFullTextSearchFunction.Filter, PgFullTextSearchFunction.Rank
-
-
Constructor Summary
Constructors Constructor Description Filter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getFragment(String table, String field, String value, Optional<String> ftsConfiguration)
org.hibernate.type.Type
getReturnType(org.hibernate.type.Type arg0, org.hibernate.engine.spi.Mapping arg1)
-
Methods inherited from class org.openbravo.client.kernel.PgFullTextSearchFunction
getFtsConfig, hasArguments, hasParenthesesIfNoArguments, render
-
-
-
-
Method Detail
-
getReturnType
public org.hibernate.type.Type getReturnType(org.hibernate.type.Type arg0, org.hibernate.engine.spi.Mapping arg1)
-
getFragment
protected String getFragment(String table, String field, String value, Optional<String> ftsConfiguration)
- Specified by:
getFragment
in classPgFullTextSearchFunction
-
-