For full text search in MySQL:
select * from Book where match(title,description) against ('TV' in BOOLEAN mode) order by match(title,description) against ('TV' in BOOLEAN mode) desc
how to translate this to EJB QL or HQL, or Criteria?
The issue is "order by".
select id, match(title,description) against ('TV' in BOOLEAN mode) as value from Book where match(title,description) against ('TV' in BOOLEAN mode) order by value desc
it did not work since the "value" is replaced by automatically generated id in select, but not in order by, which makes the resultant SQL invalid. A bug?
For criteria, addOrder(Order.desc(...)) does not accept
match(title,description) against ('TV' in BOOLEAN mode)
anything like sqlOrder(...) that accepts all expressions?
Any idea is appreciated!
Dave
|