Package org.hibernate.search.engine

Examples of org.hibernate.search.engine.Loader


      DocumentExtractor extractor = new DocumentExtractor( searchFactoryImplementor, indexProjection );
      for (int index = first; index <= max; index++) {
        //TODO use indexSearcher.getIndexReader().document( hits.id(index), FieldSelector(indexProjection) );
        infos.add( extractor.extract( 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 {
      hits = getHits( searcher );
      int first = first();
      int max = max( first, hits );
      DocumentExtractor extractor = new DocumentExtractor( searchFactory, indexProjection );
      Loader loader = getLoader( (Session) this.session, searchFactory );
      return new ScrollableResultsImpl( searcher, 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( searchFactoryImplementor, indexProjection );
      for (int index = first; index <= max; index++) {
        infos.add( extractor.extract( 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

      );
      for ( int index = first; index <= max; index++ ) {
        //TODO use indexSearcher.getIndexReader().document( hits.id(index), FieldSelector(indexProjection) );
        infos.add( extractor.extract( 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

      int first = first();
      int max = max( first, queryHits.totalHits );
      DocumentExtractor extractor = new DocumentExtractor(
          queryHits, searchFactory, indexProjection, idFieldNames,allowFieldSelectionInProjection
      );
      Loader loader = getLoader( ( Session ) this.session, searchFactory );
      return new ScrollableResultsImpl(
          searcher, first, max, fetchSize, extractor, loader, searchFactory
      );
    }
    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( 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

        }
      }
      catch ( QueryTimeoutException e ) {
        reactOnQueryTimeoutExceptionWhileExtracting( e );
      }
      Loader loader = getLoader();
      //stop timeout manager, the iterator pace is in the user's hands
      timeoutManager.stop();
      return new IteratorImpl( infos, loader );
    }
    catch ( IOException e ) {
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();
      //stop timeout manager, the iterator pace is in the user's hands
      timeoutManager.stop();
      return new ScrollableResultsImpl(
          searcher.getSearcher(), first, max, fetchSize, extractor, loader, searchFactoryImplementor, this.session
      );
View Full Code Here

        }
      }
      catch ( QueryTimeoutException e ) {
        reactOnQueryTimeoutExceptionWhileExtracting( e );
      }
      Loader loader = getLoader();
      List list = loader.load( infos.toArray( new EntityInfo[infos.size()] ) );
      //no need to timeoutManager.isTimedOut from this point, we don't do anything intensive
      if ( resultTransformer == null || loader instanceof ProjectionLoader ) {
        //stay consistent with transformTuple which can only be executed during a projection
        return list;
      }
View Full Code Here

      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

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.