Package org.hibernate.search.engine

Examples of org.hibernate.search.engine.DocumentExtractor


         int first = first();
         int max = max(first, queryHits.totalHits);
         int size = max - first + 1 < 0 ? 0 : max - first + 1;
         keyList = new ArrayList<Object>(size);

         DocumentExtractor extractor = new DocumentExtractor(queryHits, searchFactory, indexProjection, idFieldNames, allowFieldSelectionInProjection);
         for (int index = first; index <= max; index++) {
            // Since the documentId is same thing as the key in each key, value pairing. We can just get the documentId
            // from Lucene and then get it from the cache.

            // The extractor.extract.id gives me the documentId that we need.


            Object key = extractor.extract(index).id;
            keyList.add(key);
         }

      }
      catch (IOException e) {
View Full Code Here


      try {
         QueryHits queryHits = getQueryHits(searcher, calculateTopDocsRetrievalSize());
         int first = first();
         int max = max(first, queryHits.totalHits);

         DocumentExtractor extractor = new DocumentExtractor(queryHits, searchFactory, indexProjection, idFieldNames, allowFieldSelectionInProjection);

         return new LazyIterator(extractor, cache, searcher, searchFactory, first, max, fetchSize);
      }
      catch (IOException e) {
         try {
View Full Code Here

         int first = first();
         int max = max(first, queryHits.totalHits);

         int size = max - first + 1 < 0 ? 0 : max - first + 1;

         DocumentExtractor extractor = new DocumentExtractor(queryHits, searchFactory, indexProjection, idFieldNames, allowFieldSelectionInProjection);

         List<String> keysForCache = new ArrayList<String>(size);
         for (int index = first; index <= max; index++) {
            // Since the documentId is same thing as the key in each key, value pairing. We can just get the documentId
            // from Lucene and then get it from the cache.

            // The extractor.extract.id gives me the documentId that we need.

            String cacheKey = extractor.extract(index).id.toString(); // these are always strings
            keysForCache.add(cacheKey);
         }

         // Loop through my list of keys and get it from the cache. Put each object that I get into a separate list.
         List<Object> listToReturn = new ArrayList<Object>(size);
View Full Code Here

         int first = first();
         int max = max(first, queryHits.totalHits);
         int size = max - first + 1 < 0 ? 0 : max - first + 1;
         keyList = new ArrayList<Object>(size);

         DocumentExtractor extractor = new DocumentExtractor(queryHits, searchFactory, indexProjection, idFieldNames, allowFieldSelectionInProjection);
         for (int index = first; index <= max; index++) {
            // Since the documentId is same thing as the key in each key, value pairing. We can just get the documentId
            // from Lucene and then get it from the cache.

            // The extractor.extract.id gives me the documentId that we need.


            Object key = extractor.extract(index).id;
            keyList.add(key);
         }

      }
      catch (IOException e) {
View Full Code Here

      try {
         QueryHits queryHits = getQueryHits(searcher, calculateTopDocsRetrievalSize());
         int first = first();
         int max = max(first, queryHits.totalHits);

         DocumentExtractor extractor = new DocumentExtractor(queryHits, searchFactory, indexProjection, idFieldNames, allowFieldSelectionInProjection);

         return new LazyIterator(extractor, cache, searcher, searchFactory, first, max, fetchSize);
      }
      catch (IOException e) {
         try {
View Full Code Here

         int first = first();
         int max = max(first, queryHits.totalHits);

         int size = max - first + 1 < 0 ? 0 : max - first + 1;

         DocumentExtractor extractor = new DocumentExtractor(queryHits, searchFactory, indexProjection, idFieldNames, allowFieldSelectionInProjection);

         List<Object> keysForCache = new ArrayList<Object>(size);
         for (int index = first; index <= max; index++) {
            // Since the documentId is same thing as the key in each key, value pairing. We can just get the documentId
            // from Lucene and then get it from the cache.

            // The extractor.extract.id gives me the documentId that we need.

            Object cacheKey = extractor.extract(index).id;
            keysForCache.add(cacheKey);
         }

         // Loop through my list of keys and get it from the cache. Put each object that I get into a separate list.
         List<Object> listToReturn = new ArrayList<Object>(size);
View Full Code Here

      int first = first();
      int max = max( first, queryHits.totalHits );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = new DocumentExtractor(
          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 ) {
View Full Code Here

    //FIXME: handle null searcher
    try {
      QueryHits queryHits = getQueryHits( searcher, calculateTopDocsRetrievalSize() );
      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
View Full Code Here

      int first = first();
      int max = max( first, queryHits.totalHits );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = new DocumentExtractor(
          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
View Full Code Here

      int first = first();
      int max = max( first, queryHits.totalHits );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = new DocumentExtractor(
          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 ) {
View Full Code Here

TOP

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

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.