Package org.hibernate.search.engine

Examples of org.hibernate.search.engine.Loader


      DocumentExtractor extractor = new DocumentExtractor( queryAndHits.preparedQuery, searcher, searchFactoryImplementor, indexProjection );
      for (int index = first; index <= max; index++) {
        //TODO use indexSearcher.getIndexReader().document( hits.id(index), FieldSelector(indexProjection) );
        infos.add( extractor.extract( queryAndHits.hits, index ) );
      }
      Loader loader = getLoader( sess, searchFactoryImplementor );
      return new IteratorImpl( infos, loader );
    }
    catch (IOException e) {
      throw new HibernateException( "Unable to query Lucene index", e );
    }
View Full Code Here


    try {
      QueryAndHits queryAndHits = getQueryAndHits( searcher );
      int first = first();
      int max = max( first, queryAndHits.hits );
      DocumentExtractor extractor = new DocumentExtractor( queryAndHits.preparedQuery, searcher, searchFactory, indexProjection );
      Loader loader = getLoader( (Session) this.session, searchFactory );
      return new ScrollableResultsImpl( searcher, queryAndHits.hits, first, max, fetchSize, extractor, loader, searchFactory );
    }
    catch (IOException e) {
      //close only in case of exception
      try {
View Full Code Here

      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = new DocumentExtractor( queryAndHits.preparedQuery, searcher, searchFactoryImplementor, indexProjection );
      for (int index = first; index <= max; index++) {
        infos.add( extractor.extract( queryAndHits.hits, index ) );
      }
      Loader loader = getLoader( sess, searchFactoryImplementor );
      List list = loader.load( infos.toArray( new EntityInfo[infos.size()] ) );
      if ( resultTransformer == null || loader instanceof ProjectionLoader ) {
        //stay consistent with transformTuple which can only be executed during a projection
        return list;
      }
      else {
View Full Code Here

          queryHits, searchFactoryImplementor, indexProjection, idFieldNames, allowFieldSelectionInProjection
      );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
      }
      Loader loader = getLoader();
      return new IteratorImpl( infos, loader );
    }
    catch ( IOException e ) {
      throw new HibernateException( "Unable to query Lucene index", e );
    }
View Full Code Here

   * projections or <code>Criteria</code> are used.
   *
   * @return The loader instance to use to load the results of the query.
   */
  private Loader getLoader() {
    Loader loader;
    if ( indexProjection != null ) {
      loader = getProjectionLoader();
    }
    else if ( criteria != null ) {
      loader = getCriteriaLoader();
View Full Code Here

      int first = first();
      int max = max( first, queryHits.totalHits );
      DocumentExtractor extractor = new DocumentExtractor(
          queryHits, searchFactoryImplementor, indexProjection, idFieldNames, allowFieldSelectionInProjection
      );
      Loader loader = getLoader();
      return new ScrollableResultsImpl(
          searcher, first, max, fetchSize, extractor, loader, searchFactoryImplementor, this.session
      );
    }
    catch ( IOException e ) {
View Full Code Here

          queryHits, searchFactoryImplementor, indexProjection, idFieldNames, allowFieldSelectionInProjection
      );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
      }
      Loader loader = getLoader();
      List list = loader.load( infos.toArray( new EntityInfo[infos.size()] ) );
      if ( resultTransformer == null || loader instanceof ProjectionLoader ) {
        //stay consistent with transformTuple which can only be executed during a projection
        return list;
      }
      else {
View Full Code Here

          queryHits, searchFactoryImplementor, indexProjection, idFieldNames, allowFieldSelectionInProjection
      );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
      }
      Loader loader = getLoader();
      return new IteratorImpl( infos, loader );
    }
    catch ( IOException e ) {
      throw new HibernateException( "Unable to query Lucene index", e );
    }
View Full Code Here

   * projections or <code>Criteria</code> are used.
   *
   * @return The loader instance to use to load the results of the query.
   */
  private Loader getLoader() {
    Loader loader;
    if ( indexProjection != null ) {
      loader = getProjectionLoader();
    }
    else if ( criteria != null ) {
      loader = getCriteriaLoader();
View Full Code Here

      int first = first();
      int max = max( first, queryHits.totalHits );
      DocumentExtractor extractor = new DocumentExtractor(
          queryHits, searchFactoryImplementor, indexProjection, idFieldNames, allowFieldSelectionInProjection
      );
      Loader loader = getLoader();
      return new ScrollableResultsImpl(
          searcher, first, max, fetchSize, extractor, loader, searchFactoryImplementor, this.session
      );
    }
    catch ( IOException e ) {
View Full Code Here

TOP

Related Classes of org.hibernate.search.engine.Loader

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.