-->
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: FullTextQuery result size problem
PostPosted: Thu Jul 09, 2009 5:36 am 
Newbie

Joined: Tue May 19, 2009 4:49 am
Posts: 14
Hello ,

There is a strange response I am getting randomly while using FullTextQuery.

session = sessionFactory.openSession();
fullTextSession = Search.getFullTextSession(session);
SearchFactory searchFactory = fullTextSession.getSearchFactory();
Analyzer phoneticAnalyzer = searchFactory.getAnalyzer(PartyDO.class);
org.apache.lucene.queryParser.QueryParser parser = new QueryParser("partyID",phoneticAnalyzer);
// searchQuery is a simple query string , on a single field
org.apache.lucene.search.Query luceneQuery = parser.parse(searchQuery);
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery, PartyDO.class);
int resultSize = fullTextQuery.getResultSize();
System.out.println("Search Result Size >>>>>>>>>>>>"+ resultSize);
query = fullTextQuery.list();
System.out.println("Search List Size >>>>>>>>>>>>"+ query.size());



Now I expect the fullTextQuery.getResultSize(); & query.size()); to return the same value. But randomly , at times when the result size is quite big (300-300 rows) I find that the query response list comes empty.

Any idea , what could be the reason ?

Hibernate version : 3.1.0.GA


Top
 Profile  
 
 Post subject: Re: FullTextQuery result size problem
PostPosted: Thu Jul 09, 2009 8:41 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

Is there anything in the logs? For example it could help to turn on SQL debug trace and see which queries get executed. Or is there even a stack trace?

Also, could you provide some more information about your environment. Which Hibernate version, which environment are you running in - standalone app vs in container?

The best would be of course to give us some sort of a test case we can use to try to reproduce the issue.

--Hardy


Top
 Profile  
 
 Post subject: Re: FullTextQuery result size problem
PostPosted: Fri Jul 10, 2009 8:34 am 
Newbie

Joined: Tue May 19, 2009 4:49 am
Posts: 14
Hey Hardy,
Sorry for late response.
See the log below, we dont get any queries in logs , in Hibernate Search isnt? I have turned on the SQL debug trace , but could not find any query. Anyways log trace below :
Code:
DEBUG [WebContainer : 1] (org.hibernate.search.reader.SharingBufferReaderProvider:openReader:115)  - Opening IndexReader for directoryProviders: 1
[WebContainer : 1] DEBUG org.hibernate.search.reader.SharingBufferReaderProvider  - Opening IndexReader for directoryProviders: 1
DEBUG [WebContainer : 1] (org.hibernate.search.reader.SharingBufferReaderProvider:closeReader:58)  - Closing MultiReader: org.hibernate.search.reader.CacheableMultiReader@37bb37bb
[WebContainer : 1] DEBUG org.hibernate.search.reader.SharingBufferReaderProvider  - Closing MultiReader: org.hibernate.search.reader.CacheableMultiReader@37bb37bb
[7/10/09 17:55:44:953 IST] 0000002f SystemOut     O Search Result Size >>>>>>>>>>>>22
[7/10/09 17:55:44:953 IST] 0000002f SystemOut     O Search Query >>>>>>>>>>>>LastName:JOHNSON~0.3
[WebContainer : 1] (org.hibernate.search.reader.SharingBufferReaderProvider:openReader:115)  - Opening IndexReader for directoryProviders: 1
734714 [WebContainer : 1] DEBUG org.hibernate.search.reader.SharingBufferReaderProvider  - Opening IndexReader for directoryProviders: 1
DEBUG [WebContainer : 1] (org.hibernate.search.reader.SharingBufferReaderProvider:closeReader:58)  - Closing MultiReader: org.hibernate.search.reader.CacheableMultiReader@37bb37bb
[WebContainer : 1] DEBUG org.hibernate.search.reader.SharingBufferReaderProvider  - Closing MultiReader: org.hibernate.search.reader.CacheableMultiReader@37bb37bb
[7/10/09 17:55:44:953 IST] 0000002f SystemOut     O Search List Size >>>>>>>>>>>>0


I usually get this error when I make a query with Approx search with very low approximation (~0.1 - ~0.3) , above that i.e. (~0.5-~0.8) works good or when I try fetching the results using pagination.


Top
 Profile  
 
 Post subject: Re: FullTextQuery result size problem
PostPosted: Fri Jul 10, 2009 9:06 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
What do we see in the log? Two consecutive searches? There shoud be some SQL, however? Did you set hibernate.show_sql to true in your configuration?

Maybe you could provide a full example, including annotated classes, indexing and search code.

--Hardy


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.