-->
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: join statements with full text query?
PostPosted: Thu Oct 11, 2007 9:40 am 
Newbie

Joined: Mon Oct 08, 2007 3:13 pm
Posts: 6
Hi

This is my sample Full Text quey with full text index on Mediafile object.

public void dbuserFullTextQuery(){
try {
Session session = getHibernateTemplate().getSessionFactory().openSession();
FullTextSession fullTextSession = Search.createFullTextSession(session);
Transaction tx = fullTextSession.beginTransaction();

MultiFieldQueryParser parser = new MultiFieldQueryParser( new String[]{"title"}, new StandardAnalyzer());
Query query = parser.parse("chapel");
org.hibernate.search.FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Mediafile.class );
List result = hibQuery.list();
tx.commit();
}catch(Exception e) {
e.printStackTrace();
}
}



Below is my real query which i am trying to convert it to full text query.
this query has join to other tables like mime, datastore.

String hql = "select new edu.princeton.almagest.viewObjects.MediaItems (media.mediafileId,media.title,rfds.datastore,media.filename,media.thumbfilename,mime.mimetype,media.archiveByArchiveId.archiveId)"
+ " from Dbuser ws "
+ " join ws.mediafilesByDbuserId media "
+ " join media.mimetype mime "
+ " join media.refDatastore rfds "
+ " where media.title like :searchString ";


Can some one guide me, how do i write above query so that it can be benefitted from full text index i have created on Mediafile table?

My problem is i don't know how to write join statements with full text query.

I know i can fire 2 queries. One to get ids using full text query and second query will use those ids to restirct the output of second query. But is there any way to combine full text query with join statements?


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.