We're updating the issue view to help you get more done. 

Add support for SAP HANA full-text search functions

Description

There is no support for the SAP HANA full-text search functions (CONTAINS, SCORE, HIGHLIGHTED, SNIPPETS) in the HANA Hibernate dialect.

SCORE, HIGHLIGHTED, and SNIPPETS can be added easily as these are regular functions.

CONTAINS is more difficult, because it's actually a predicate, i.e. it doesn't take an operator and a comparison expression, which isn't supported by the HQL parser. For now, the best workaround seems to be to introduce a dummy function that can act as the right-hand side of the expression that in conjunction with the CONTAINS function implementation will remove the operator via a SQL comment.

Since negation of a predicate is also not possible for the reasons listed above, a NOT_CONTAINS function is also needed that can be used to create negative CONTAINS queries.

Example

The HQL query

1 select e from Entity e where contains(e.c, 'text') = contains_rhs()

will translate to the native SQL query

1 select * from Entity e where contains(e.c, 'text') /*=*/

Example 2

The HQL query

1 select e from Entity e where not_contains(e.c, 'text') = contains_rhs()

will translate to the native SQL query

1 select * from Entity e where not contains(e.c, 'text') /*=*/

Environment

SAP HANA

Status

Assignee

Jonathan Bregler

Reporter

Jonathan Bregler

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.17
5.3.6

Priority

Major