-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Order by - Full text search support
PostPosted: Thu Mar 08, 2007 9:47 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.