-->
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.  [ 3 posts ] 
Author Message
 Post subject: searching for libraries that sorts results
PostPosted: Tue Mar 07, 2006 7:10 am 
Newbie

Joined: Fri Aug 06, 2004 1:01 pm
Posts: 13
Hi,

I am wondering if there is some kind of library based on hibernate or not, that would return for a search :
- results that corresponds to the criterias
- plus results that do not exactly correspond to the criterias ordered by relevance

For instance if you have 5 criterias :
I would like to get the results that have those 5 criterias, then the results that have just 4, then 3 ...

Do you know of any library that does that ??

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 07, 2006 5:56 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
HIbernate is the library.. there's nothing that hibernate can make use of to provide additional functionality.

You could write a more complex query, returning a rating for each result along with the result. This would involve complex subqueries, and the return from the eventual list() method would be an Object[2] rather than an instance of the class you're searching for, so dealing with that is a bit more complex too.

If you're not too fussy about the rating, the Subqueries class provides a few methods, all of which have "some" in their name, that do something approaching fuzzy searching.

Finally, the easiest but least efficient option is to do multiple searches, one for each criterion, then build a final result list from it. Whenever an item appears in a list, its rating is incremented.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 08, 2006 9:26 am 
Newbie

Joined: Fri Aug 06, 2004 1:01 pm
Posts: 13
It's seems compass is doing it, for the ones that might be interested. In facts lucene does it, and compass uses lucene.


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

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.