Package org.hibernate.search.backend

Examples of org.hibernate.search.backend.PurgeAllLuceneWork


    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here


     */
    public void enqueueLuceneWork(List<LuceneWork> luceneQueue) {
      final Set<Entry<Serializable, PerEntityWork>> entityInstances = entityById.entrySet();
      ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
      if ( purgeAll ) {
        luceneQueue.add( new PurgeAllLuceneWork( entityClass ) );
      }
      for ( Entry<Serializable, PerEntityWork> entry : entityInstances ) {
        Serializable indexingId = entry.getKey();
        PerEntityWork perEntityWork = entry.getValue();
        perEntityWork.enqueueLuceneWork( entityClass, indexingId, documentBuilder, luceneQueue, conversionContext );
View Full Code Here

    if ( this.purgeAtStart ) {
      //purgeAll for affected entities
      Set<Class<?>> targetedClasses = searchFactoryImplementor.getIndexedTypesPolymorphic( rootEntities );
      for ( Class<?> clazz : targetedClasses ) {
        //needs do be in-sync work to make sure we wait for the end of it.
        backend.doWorkInSync( new PurgeAllLuceneWork( clazz ) );
      }
      if ( this.optimizeAfterPurge ) {
        optimize( targetedClasses );
      }
    }
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = objectToString(idBridge, idKeywordName, id);
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = objectToString(idBridge, idKeywordName, id);
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

    }
    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      Document doc = getDocument( entity, id );
      /**
       * even with Lucene 2.1, use of indexWriter to update is not an option
View Full Code Here

    Class<?> entityClass = ClassLoaderHelper.classForName(
        entityClassName,
        LuceneWorkHydrator.class.getClassLoader(),
        "entity class"
    );
    results.add( new PurgeAllLuceneWork( entityClass ) );
  }
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = objectToString( idBridge, idKeywordName, id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = objectToString( idBridge, idKeywordName, id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

    Class<?> entityClass = ClassLoaderHelper.classForName(
        entityClassName,
        "entity class",
        searchFactory.getServiceManager()
    );
    results.add( new PurgeAllLuceneWork( entityClass ) );
  }
View Full Code Here

  public static List<LuceneWork> buildWorks() throws Exception {
    List<LuceneWork> works = new ArrayList<LuceneWork>();
    works.add( OptimizeLuceneWork.INSTANCE );
    works.add( OptimizeLuceneWork.INSTANCE );
    works.add( new OptimizeLuceneWork( RemoteEntity.class ) ); //class won't be send over
    works.add( new PurgeAllLuceneWork( RemoteEntity.class ) );
    works.add( new PurgeAllLuceneWork( RemoteEntity.class ) );
    works.add( new DeleteLuceneWork( 123l, "123", RemoteEntity.class ) );
    works.add( new DeleteLuceneWork( "Sissi", "Sissi", RemoteEntity.class ) );
    works.add(
        new DeleteLuceneWork(
            new URL( "http://emmanuelbernard.com" ),
View Full Code Here

TOP

Related Classes of org.hibernate.search.backend.PurgeAllLuceneWork

Copyright © 2018 www.massapicom. 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.