Package org.hibernate.search.query.engine.impl

Examples of org.hibernate.search.query.engine.impl.DocumentExtractorImpl


    assertEquals( "Should have found a match", 1, sizeOfDuplicate );
  }

  private int extractResultSize(HSQuery hsQuery) {
    DocumentExtractorImpl documentExtractor = (DocumentExtractorImpl) hsQuery.queryDocumentExtractor();
    TopDocs topDocs = documentExtractor.getTopDocs();
    documentExtractor.close();
    return topDocs.totalHits;
  }
View Full Code Here


    Set<String> identifiers = new HashSet<String>();
    identifiers.add( "providedId" );
    Set<Class<?>> targetedClasses = new HashSet<Class<?>>();
    targetedClasses.add( ProvidedIdPerson.class );
    targetedClasses.add( ProvidedIdPersonSub.class );
    DocumentExtractor extractor = new DocumentExtractorImpl(
        queryHits, sf, new String[] { "name" },
        identifiers, false,
        lowLevelSearcher,
        luceneQuery,
        0, 0, //not used in this case
        targetedClasses
    );
    HashSet<String> titles = new HashSet<String>( 3 );
    for ( int id = 0; id < hits.totalHits; id++ ) {
      Long documentId = (Long) extractor.extract( id ).getId();
      String projectedTitle = (String) extractor.extract( id ).getProjection()[0];
      assertNotNull( projectedTitle );
      titles.add( projectedTitle );
    }
    assertTrue( titles.contains( "Regular goat" ) );
    assertTrue( titles.contains( "Mini Goat" ) );
View Full Code Here

TOP

Related Classes of org.hibernate.search.query.engine.impl.DocumentExtractorImpl

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.