-->
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.  [ 2 posts ] 
Author Message
 Post subject: lucene FTQ combined with hibernate Criterion [index + DB]
PostPosted: Sat Apr 19, 2008 6:15 am 
Newbie

Joined: Sun May 14, 2006 7:31 am
Posts: 10
Hi All,

I'm wondering if there is a gentle way to create a Query where some clauses hit a lucene index and others hit the database persisted objects.

I leverage my question :

I wondering if something similar is possible
Code:
Criteria criteria;
{add some Criterion -> DB}
criteria.add(Expression.eq("field", "value");

org.apache.lucene.search.Query luceneQuery;
{create the lucene query string and parse it -> Lucene Index}

FullTextQuery ftp = fullTextSession.createFullTextQuery(luceneQuery);

ftq.setCriteriaQuery(criteria);

query.list();


Is someone inspired :-D ?

Ty

Best.

andy


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 19, 2008 11:04 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
this is currently not possible, and probably will never be as I don't see how it could be implemented in an efficient way.

I have had a similar need, what whe did is put some more data in the lucene index to get the same effect: searching on some fields by fulltext and others by id.

We have a complex search form with many fields, when a user fills some we have a strategy selection: depending on the fields we choose the Criteria implementation or the Lucene implementation, returning a paged list of managed entities anyway.

regards,

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.