Package org.hibernate.search

Examples of org.hibernate.search.FullTextSession.index()


      s.index( result.get( i ) );
    tx.commit(); //do the process
    s.index( result.get(loop/2) ); //do the process out of tx
    tx = s.beginTransaction();
    for (int i = loop/2+1 ; i < loop; i++)
      s.index( result.get( i ) );
    tx.commit(); //do the process
    s.close();

    s = new FullTextSessionImpl( openSession() );
    tx = s.beginTransaction();
View Full Code Here


      while (results.next() == true) {
        final Object obj = results.get(0);
        if (obj instanceof ExtendedBaseDO< ? >) {
          ((ExtendedBaseDO< ? >) obj).recalculate();
        }
        fullTextSession.index(obj); // index each element
        if (index++ % batchSize == 0)
          session.flush(); // clear every batchSize since the queue is processed
      }
    } else {
      criteria = createCriteria(session, clazz, settings, false);
View Full Code Here

      final List< ? > list = criteria.list();
      for (final Object obj : list) {
        if (obj instanceof ExtendedBaseDO< ? >) {
          ((ExtendedBaseDO< ? >) obj).recalculate();
        }
        fullTextSession.index(obj);
        if (index++ % batchSize == 0)
          session.flush(); // clear every batchSize since the queue is processed
      }
    }
    final SearchFactory searchFactory = fullTextSession.getSearchFactory();
View Full Code Here

    try {
      BaseDO< ? > dbObj = (BaseDO< ? >) session.get(obj.getClass(), obj.getId());
      if (dbObj == null) {
        dbObj = (BaseDO< ? >) session.load(obj.getClass(), obj.getId());
      }
      fullTextSession.index(dbObj);
      alreadyReindexed.add(getReindexId(dbObj));
      if (log.isDebugEnabled() == true) {
        log.debug("Object added to index: " + getReindexId(dbObj));
      }
    } catch (final Exception ex) {
View Full Code Here

            .setFetchMode("actors", FetchMode.JOIN)
            .setFetchMode("categories", FetchMode.JOIN)
            .list();
      for (Object obj : results)
      {
         fullTextSession.index(obj);
      }
   }

   private FullTextSession getFullTextSession()
   {
View Full Code Here

      FullTextSession fullTextSession = getFullTextSession();
      for (Class entityType : entityTypes)
      {
         for (Object obj : fullTextSession.createCriteria(entityType).list())
         {
            fullTextSession.index(obj);
         }
      }
   }

   @Remove
View Full Code Here

    private void index() {
        FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
        List results = ftSession.createCriteria(Book.class).list();
        for (Object obj : results) {
            ftSession.index(obj);
        }
    }

    private void purge() {
        FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.