Package org.hibernate.search.backend

Examples of org.hibernate.search.backend.LuceneWork


      IndexManager indexManager = searchFactory.getIndexManagerHolder().getIndexManager(indexName);
      if (indexManager == null) {
         throw new SearchException("Unknown index referenced : " + indexName);
      }
      List<LuceneWork> luceneWorks = indexManager.getSerializer().toLuceneWorks(this.serializedModel);
      LuceneWork workToApply = transformKeyToStrings(luceneWorks.iterator().next());
      indexManager.performStreamOperation(workToApply, null, true);
      return Boolean.TRUE;
   }
View Full Code Here


  @Override
  public void addDeleteLuceneWork(String entityClassName, byte[] idAsByte) {
    Class<?> entityClass = ClassLoaderHelper.classForName( entityClassName, LuceneWorkHydrator.class, "entity class" );
    Serializable id = toSerializable( idAsByte, loader );
    LuceneWork result = new DeleteLuceneWork(
        id,
        objectIdInString(entityClass, id),
        entityClass
    );
    results.add( result );
View Full Code Here

  @Override
  public void addAddLuceneWork(String entityClassName, byte[] idAsByte, Map<String, String> fieldToAnalyzerMap) {
    Class<?> entityClass = ClassLoaderHelper.classForName( entityClassName, LuceneWorkHydrator.class, "entity class" );
    Serializable id = toSerializable( idAsByte, loader );
    LuceneWork result = new AddLuceneWork(
        id,
        objectIdInString(entityClass, id),
        entityClass,
        getLuceneDocument(),
        fieldToAnalyzerMap
View Full Code Here

  @Override
  public void addUpdateLuceneWork(String entityClassName, byte[] idAsByte, Map<String, String> fieldToAnalyzerMap) {
    Class<?> entityClass = ClassLoaderHelper.classForName( entityClassName, LuceneWorkHydrator.class, "entity class" );
    Serializable id = toSerializable( idAsByte, loader );
    LuceneWork result = new UpdateLuceneWork(
        id,
        objectIdInString(entityClass, id),
        entityClass,
        getLuceneDocument(),
        fieldToAnalyzerMap
View Full Code Here

  private static final Log log = LoggerFactory.make();
 
  public void handle(ErrorContext context) {
   
    final List<LuceneWork> failingOperations = context.getFailingOperations();
    final LuceneWork primaryFailure = context.getOperationAtFault();
    final Throwable exceptionThatOccurred = context.getThrowable();
   
    final StringBuilder errorMsg = new StringBuilder();
   
    if ( exceptionThatOccurred != null ) {
View Full Code Here

    Class<?> entityClass = ClassLoaderHelper.classForName(
        entityClassName,
        LuceneWorkHydrator.class,
        "entity class"
    );
    LuceneWork result = new DeleteLuceneWork(
        id,
        objectIdInString( entityClass, id, conversionContext ),
        entityClass
    );
    results.add( result );
View Full Code Here

    Class<?> entityClass = ClassLoaderHelper.classForName(
        entityClassName,
        LuceneWorkHydrator.class,
        "entity class"
    );
    LuceneWork result = new AddLuceneWork(
        id,
        objectIdInString( entityClass, id, conversionContext ),
        entityClass,
        getLuceneDocument(),
        fieldToAnalyzerMap
View Full Code Here

    Class<?> entityClass = ClassLoaderHelper.classForName(
        entityClassName,
        LuceneWorkHydrator.class,
        "entity class"
    );
    LuceneWork result = new UpdateLuceneWork(
        id,
        objectIdInString( entityClass, id, conversionContext ),
        entityClass,
        getLuceneDocument(),
        fieldToAnalyzerMap
View Full Code Here

  private static final Logger log = LoggerFactory.make();
 
  public void handle(ErrorContext context) {
   
    final List<LuceneWork> failingOperations = context.getFailingOperations();
    final LuceneWork primaryFailure = context.getOperationAtFault();
    final Throwable exceptionThatOccurred = context.getThrowable();
   
    final StringBuilder errorMsg = new StringBuilder();
   
    if ( exceptionThatOccurred != null ) {
View Full Code Here

    doc.add( field );
    field = new Field( "id", "1", Field.Store.YES, Field.Index.NOT_ANALYZED );
    doc.add( field );
    field = new Field( "logo", shirt.getLogo(), Field.Store.NO, Field.Index.ANALYZED );
    doc.add( field );
    LuceneWork luceneWork = new AddLuceneWork(
        shirt.getId(), String.valueOf( shirt.getId() ), shirt.getClass(), doc
    );
    List<LuceneWork> queue = new ArrayList<LuceneWork>();
    queue.add( luceneWork );
    return queue;
View Full Code Here

TOP

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

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.