-->
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.  [ 6 posts ] 
Author Message
 Post subject: Only One Result in IndexedEmbedded Collection is Indexed
PostPosted: Wed Mar 31, 2010 12:42 pm 
Newbie

Joined: Wed Feb 10, 2010 5:07 am
Posts: 11
I am indexing fine for my classes and their @IndexedEmbedded collections/relations. However if I introduce a join on the criteria in my scrollable results only 1 record is retrieved for each Collection, and only one result is indexed.

Has anybody come across this problem before?

Code:
        FullTextSession fullTextSession = getFullTextSession();
        fullTextSession.setCacheMode(CacheMode.IGNORE);
        fullTextSession.setFlushMode(FlushMode.MANUAL);
       
        // TODO remove this log info after we've received enough info about indexing times
       
        fullTextSession.purgeAll(getPersistentClass());
       
        Criteria criteria = fullTextSession.createCriteria(getPersistentClass()).setFetchSize(INDEX_BATCH_SIZE);
        criteria.setFetchMode("collectionName", FetchMode.JOIN);
        ScrollableResults results = criteria.scroll(ScrollMode.FORWARD_ONLY);
       
        int batch = 0;
        // commit each result from the db to the index
        while (results.next()) {
            fullTextSession.index(results.get(0));
            // flush to index on the disk to prevent out of memory errors
            if (++batch % INDEX_BATCH_SIZE == 0) {
                fullTextSession.flushToIndexes();
                fullTextSession.clear();
            }
        }
       
        fullTextSession.getSearchFactory().optimize(getPersistentClass());


Top
 Profile  
 
 Post subject: Re: Only One Result in IndexedEmbedded Collection is Indexed
PostPosted: Thu Apr 01, 2010 2:18 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
I'm assuming you're forcing the fetchmode to have it perform better?

Could you try to verify if the problem is that you're only indexing one object or actually loading just one object?

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


Top
 Profile  
 
 Post subject: Re: Only One Result in IndexedEmbedded Collection is Indexed
PostPosted: Fri Apr 02, 2010 5:33 am 
Newbie

Joined: Wed Feb 10, 2010 5:07 am
Posts: 11
Hi,

it works in all cases.

I came across this bug with ScrollableResult

http://opensource.atlassian.com/project ... e/HHH-1283

It appears this is not related to Hibernate Search, but a bug in core Hibernate, where if you set a JoinMode on a collection it only returns one result.


Top
 Profile  
 
 Post subject: Re: Only One Result in IndexedEmbedded Collection is Indexed
PostPosted: Fri Apr 02, 2010 7:59 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
thanks for the reference.

If you need it to perform faster I'd suggest you try out the latest Search beta which is having an optimized batch indexer.

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


Top
 Profile  
 
 Post subject: Re: Only One Result in IndexedEmbedded Collection is Indexed
PostPosted: Tue May 18, 2010 7:11 am 
Newbie

Joined: Mon May 17, 2010 8:00 am
Posts: 2
Some solution was found ?


Top
 Profile  
 
 Post subject: Re: Only One Result in IndexedEmbedded Collection is Indexed
PostPosted: Tue May 18, 2010 7:55 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
this could be relevant, it was fixed in version 3.2.0 : HSEARCH-476

_________________
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.  [ 6 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.