-->
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.  [ 3 posts ] 
Author Message
 Post subject: IndexEmbedded collections not updating on re-index.
PostPosted: Sat Jun 01, 2013 2:34 am 
Newbie

Joined: Fri Oct 10, 2008 9:17 am
Posts: 13
Greetings,

We have a problem were our @IndexEmbedded collections are indexed when the object is saved or updated, but if we use the Mass Indexer to index, then they are not.

We have a Page object, which has a collection of PageModerators, this object basically links the Page with an Account. Is there anything about this structure that would prevent it from being re-indexed? Or is it how we use the MassIndexer?

Any insights appreciated

Code:
@Entity @Table(name="page") @Indexed
public class Page
{
   @Id @GeneratedValue(strategy = GenerationType.AUTO) @DocumentId
   private int id;

   @OneToMany(cascade = { CascadeType.ALL }, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "page")
   @IndexedEmbedded
   private Set<PageModerator> acl;
}


@Entity @Table(name="page_acl") @Indexed
public class PageModerator extends Moderator
{
   @ManyToOne( cascade = {} ) @JoinColumn(name="page_page_fk")
   @IndexedEmbedded(includePaths = { "id" })
   private Page page;
   
   @ManyToOne( cascade = {} ) @JoinColumn(name="page_account_fk")
   @IndexedEmbedded(includePaths = { "id" })
   private Account account;
}


      FullTextSession fts = Search.getFullTextSession(sessionFactory.getCurrentSession());
      SimpleIndexingProgressMonitor monitor = new SimpleIndexingProgressMonitor();
      MassIndexer indexer = fts.createIndexer(Page.class)
            .batchSizeToLoadObjects(100).threadsForSubsequentFetching(8)
            .threadsToLoadObjects(4).threadsForSubsequentFetching(8)
            .threadsToLoadObjects(8).cacheMode(CacheMode.NORMAL);
      try {
         ReflectionUtils.setFieldValue(MassIndexerImpl.class, "monitor", indexer, monitor);
         indexer.startAndWait();
         }
      catch ....



Top
 Profile  
 
 Post subject: Re: IndexEmbedded collections not updating on re-index.
PostPosted: Thu Feb 12, 2015 9:19 pm 
Newbie

Joined: Sun Nov 30, 2014 1:43 pm
Posts: 8
Did you ever figure this out? I am having the exact same problem.


Top
 Profile  
 
 Post subject: Re: IndexEmbedded collections not updating on re-index.
PostPosted: Tue Feb 24, 2015 8:50 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Is any error logged?

The MassIndexer won't propagate all internal exceptions, some issues during indexing are only logged, or intercepted by a custom ErrorHandler but I'm guessing you didn't register one?

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