Examples of DocumentExtractor


Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

      facets = facetResults.get( facetingName );
    }
    if ( facets != null ) {
      return facets;
    }
    DocumentExtractor queryDocumentExtractor = query.queryDocumentExtractor();
    queryDocumentExtractor.close();
    //handle edge case of an empty index
    if ( facetResults == null ) {
      return Collections.emptyList();
    }
    List<Facet> results = facetResults.get( facetingName );
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

      int first = getFirstResultIndex();
      int max = max( first, queryHits.getTotalHits() );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = buildDocumentExtractor( searcher, queryHits, first, max );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
        //TODO should we measure on each extractor?
        if ( index % 10 == 0 ) {
          getTimeoutManager().isTimedOut();
        }
      }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

      int first = getFirstResultIndex();
      int max = max( first, queryHits.getTotalHits() );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = buildDocumentExtractor( searcher, queryHits, first, max );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
        //TODO should we measure on each extractor?
        if ( index % 10 == 0 ) {
          getTimeoutManager().isTimedOut();
        }
      }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

      int first = getFirstResultIndex();
      int max = max( first, queryHits.getTotalHits() );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = buildDocumentExtractor( searcher, queryHits, first, max );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
        //TODO should we measure on each extractor?
        if ( index % 10 == 0 ) {
          getTimeoutManager().isTimedOut();
        }
      }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

      facets = facetResults.get( facetingName );
    }
    if ( facets != null ) {
      return facets;
    }
    DocumentExtractor queryDocumentExtractor = query.queryDocumentExtractor();
    queryDocumentExtractor.close();
    //handle edge case of an empty index
    if (facetResults == null) {
      return Collections.emptyList();
    }
    List<Facet> results = facetResults.get( facetingName );
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

      int first = getFirstResultIndex();
      int max = max( first, queryHits.getTotalHits() );

      int size = max - first + 1 < 0 ? 0 : max - first + 1;
      List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
      DocumentExtractor extractor = buildDocumentExtractor( searcher, queryHits, first, max );
      for ( int index = first; index <= max; index++ ) {
        infos.add( extractor.extract( index ) );
        //TODO should we measure on each extractor?
        if ( index % 10 == 0 ) {
          getTimeoutManager().isTimedOut();
        }
      }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

  public ScrollableResults scroll() throws HibernateException {
    //keep the searcher open until the resultset is closed

    hSearchQuery.getTimeoutManager().start();
    final DocumentExtractor documentExtractor = hSearchQuery.queryDocumentExtractor();
    //stop timeout manager, the iterator pace is in the user's hands
    hSearchQuery.getTimeoutManager().stop();
    Loader loader = getLoader();
    return new ScrollableResultsImpl(
        fetchSize,
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

   private List<EntityInfo> entityInfos = new ArrayList<EntityInfo>();
   private AdvancedCache<String, String> cache;

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testLazyIteratorInitWithInvalidFetchSize() throws IOException {
      DocumentExtractor extractor = mock(DocumentExtractor.class);
      when(extractor.extract(anyInt())).thenAnswer(new Answer<EntityInfo>() {
         @Override
         public EntityInfo answer(InvocationOnMock invocation) throws Throwable {
            int index = (Integer) invocation.getArguments()[0];
            return entityInfos.get(index);
         }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

   private AdvancedCache<String, String> cache;

   @Test
   public void testLazyIteratorHandlesVeryLargeFetchSize() throws IOException {
      cache = mock(AdvancedCache.class);
      DocumentExtractor extractor = mock(DocumentExtractor.class);
      new LazyIterator(extractor, new EntityLoader(cache, new KeyTransformationHandler()), VERY_LARGE_FETCH_SIZE);
   }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.DocumentExtractor

  @Override
  public ScrollableResults scroll() {
    //keep the searcher open until the resultset is closed

    hSearchQuery.getTimeoutManager().start();
    final DocumentExtractor documentExtractor = hSearchQuery.queryDocumentExtractor();
    //stop timeout manager, the iterator pace is in the user's hands
    hSearchQuery.getTimeoutManager().stop();
    Loader loader = getLoader();
    return new ScrollableResultsImpl(
        fetchSize,
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.