Examples of DocumentBuilderIndexedEntity


Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

  private Query createQuery(FieldContext fieldContext, ConversionContext conversionContext) {
    final Query perFieldQuery;
    final String fieldName = fieldContext.getField();
    final Analyzer queryAnalyzer = queryContext.getQueryAnalyzer();

    final DocumentBuilderIndexedEntity documentBuilder = Helper.getDocumentBuilder( queryContext );

    final FieldBridge fieldBridge = fieldContext.getFieldBridge() != null ? fieldContext.getFieldBridge() : documentBuilder.getBridge( fieldContext.getField() );

    final Object fromObject = rangeContext.getFrom();
    final Object toObject = rangeContext.getTo();

    if ( fieldBridge != null && NumericFieldBridge.class.isAssignableFrom( fieldBridge.getClass() ) ) {
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

  @Override
  public void performWork(LuceneWork work, IndexWriter writer, IndexingMonitor monitor) {
    final Class<?> entityType = work.getEntityClass();
    final Serializable id = work.getId();
    log.tracef( "Removing %s#%s by query.", entityType, id );
    DocumentBuilderIndexedEntity builder = workspace.getDocumentBuilder( entityType );

    BooleanQuery entityDeletionQuery = new BooleanQuery();

    Query idQueryTerm;
    if ( isIdNumeric( builder ) ) {
      idQueryTerm = NumericFieldUtils.createExactMatchQuery( builder.getIdKeywordName(), id );
    }
    else {
      Term idTerm = new Term( builder.getIdKeywordName(), work.getIdInString() );
      idQueryTerm = new TermQuery( idTerm );
    }
    entityDeletionQuery.add( idQueryTerm, BooleanClause.Occur.MUST );

    Term classNameQueryTerm = new Term( ProjectionConstants.OBJECT_CLASS, entityType.getName() );
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

          return;
      }
      //default: continue indexing this instance
    }

    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    conversionContext.pushProperty( docBuilder.getIdKeywordName() );
    String idInString = null;
    try {
      idInString = conversionContext
          .setClass( clazz )
          .twoWayConversionContext( idBridge )
          .objectToString( id );
    }
    finally {
      conversionContext.popProperty();
    }
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork(
        clazz,
        entity,
        id,
        idInString,
        sessionInitializer,
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

        return;
      }
      //default: continue indexing this instance
    }

    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    conversionContext.pushProperty( docBuilder.getIdKeywordName() );
    String idInString = null;
    try {
      idInString = conversionContext
          .setClass( clazz )
          .twoWayConversionContext( idBridge )
          .objectToString( id );
    }
    finally {
      conversionContext.popProperty();
    }
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork(
        clazz,
        entity,
        id,
        idInString,
        sessionInitializer,
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private AddLuceneWork createAddLuceneWork(Object entity, InstanceInitializer sessionInitializer,
      ConversionContext conversionContext, Serializable id, Class<?> clazz, EntityIndexBinder entityIndexBinding) {
    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    String idInString = idInString( conversionContext, id, clazz, docBuilder );
    // depending on the complexity of the object graph going to be indexed it's possible
    // that we hit the database several times during work construction.
    return docBuilder.createAddWork( clazz, entity, id, idInString, sessionInitializer, conversionContext );
  }
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

      // it might be possible to receive not-indexes subclasses of the currently indexed type;
      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }
    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    ContextualException2WayBridge contextualBridge = new ContextualException2WayBridge()
        .setClass(clazz)
        .setFieldName(docBuilder.getIdKeywordName())
        .setFieldBridge(idBridge);
    String idInString = contextualBridge.objectToString( id );
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork( clazz, entity, id, idInString, sessionInitializer );
    backend.enqueueAsyncWork( addWork );
  }
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

          return;
      }
      //default: continue indexing this instance
    }

    DocumentBuilderIndexedEntity docBuilder = entityIndexBinding.getDocumentBuilder();
    TwoWayFieldBridge idBridge = docBuilder.getIdBridge();
    conversionContext.pushProperty( docBuilder.getIdKeywordName() );
    String idInString = null;
    try {
      idInString = conversionContext
          .setClass( clazz )
          .twoWayConversionContext( idBridge )
          .objectToString( id );
    }
    finally {
      conversionContext.popProperty();
    }
    //depending on the complexity of the object graph going to be indexed it's possible
    //that we hit the database several times during work construction.
    AddLuceneWork addWork = docBuilder.createAddWork(
        clazz,
        entity,
        id,
        idInString,
        sessionInitializer,
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

      }
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              mappedEntity.getSimilarity(),
              cfg.getReflectionManager(),
              optimizationBlackListedTypes,
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

      }
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              mappedEntity.getSimilarity(),
              cfg.getReflectionManager(),
              optimizationBlackListedTypes,
View Full Code Here

Examples of org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity

   
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
          new DocumentBuilderIndexedEntity(
              mappedXClass,
              context,
              mappedEntity.getSimilarity(),
              reflectionManager,
              optimizationBlackListedTypes,
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.