-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Search: how to get all records from
PostPosted: Tue May 13, 2008 3:13 am 
Newbie

Joined: Tue Oct 10, 2006 2:38 pm
Posts: 17
Hello

How can I get all indexed records, sorted by a field? Code like this will not work because first char can not be *:

Code:
String expression = "username:*";
org.apache.lucene.search.Query q = parser.parse( expresion.trim() );
hibQuery = fullTextEntityManager.createFullTextQuery(q,Users.class);
hibQuery.setSort(new Sort("location"));
List result = hibQuery.getResultList();



thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 13, 2008 1:14 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
I'm sure this is possible, but you should use the database to do this,
avoiding the fulltext engine.

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


Top
 Profile  
 
 Post subject: Matching all documents
PostPosted: Tue May 13, 2008 11:40 pm 
Newbie

Joined: Fri Mar 04, 2005 4:27 pm
Posts: 13
Make your query a MatchAllDocsQuery. Yes, it is that simple.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 14, 2008 2:10 am 
Newbie

Joined: Tue Oct 10, 2006 2:38 pm
Posts: 17
thanks a lot


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