Package org.hibernate.search.query.engine.spi

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


    * @return
    */
   public Object getValue(UUID queryUuid, int docIndex) {
      touch(queryUuid);

      DocumentExtractor extractor = queries.get(queryUuid);

      if (extractor == null) {
         throw new IllegalStateException("Query not found!");
      }

View Full Code Here


    *
    * @param id
    *           The id of the query
    */
   public void kill(UUID id) {
      DocumentExtractor extractor = queries.remove(id);
      ageOrderedQueries.remove(id);
      if (extractor != null)
         extractor.close();
   }
View Full Code Here

  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

    * @return
    */
   public Object getValue(UUID queryUuid, int docIndex) {
      touch(queryUuid);

      DocumentExtractor extractor = queries.get(queryUuid);

      if (extractor == null) {
         throw new IllegalStateException("Query not found!");
      }

View Full Code Here

    *
    * @param id
    *           The id of the query
    */
   public void kill(UUID id) {
      DocumentExtractor extractor = queries.remove(id);
      ageOrderedQueries.remove(id);
      if (extractor != null)
         extractor.close();
   }
View Full Code Here

public class CQCreateLazyQuery extends ClusteredQueryCommandWorker {

   @Override
   public QueryResponse perform() {
      query.afterDeserialise((SearchFactoryImplementor) getSearchFactory());
      DocumentExtractor extractor = query.queryDocumentExtractor();
      int resultSize = query.queryResultSize();

      QueryBox box = getQueryBox();
     
      // registering...
      box.put(lazyQueryId, extractor);
     
      // returning the QueryResponse
      TopDocs topDocs = extractor.getTopDocs();
      QueryResponse queryResponse = new QueryResponse(topDocs, box.getMyId(), resultSize);
      queryResponse.setAddress(cache.getAdvancedCache().getRpcManager().getAddress());
      return queryResponse;
   }
View Full Code Here

public class CQGetResultSize extends ClusteredQueryCommandWorker {

   @Override
   public QueryResponse perform() {
      query.afterDeserialise((SearchFactoryImplementor) getSearchFactory());
      DocumentExtractor extractor = query.queryDocumentExtractor();
      try {
         int resultSize = query.queryResultSize();
         QueryResponse queryResponse = new QueryResponse(resultSize);
         return queryResponse;
      } finally {
         extractor.close();
      }
   }
View Full Code Here

public class CQCreateEagerQuery extends ClusteredQueryCommandWorker {

   @Override
   public QueryResponse perform() {
      query.afterDeserialise((SearchFactoryImplementor) getSearchFactory());
      DocumentExtractor extractor = query.queryDocumentExtractor();
      try {
         int resultSize = query.queryResultSize();
         ISPNEagerTopDocs eagerTopDocs = collectKeys(extractor);
         QueryResponse queryResponse = new QueryResponse(eagerTopDocs, getQueryBox().getMyId(), resultSize);
         queryResponse.setAddress(cache.getAdvancedCache().getRpcManager().getAddress());
         return queryResponse;
      }
      finally {
         extractor.close();
      }
   }
View Full Code Here

      if (fetchOptions.getFetchMode() == FetchOptions.FetchMode.EAGER) {
         hSearchQuery.getTimeoutManager().start();
         List<EntityInfo> entityInfos = hSearchQuery.queryEntityInfos();
         return filterNulls(new EagerIterator(entityInfos, getResultLoader(), fetchOptions.getFetchSize()));
      } else if (fetchOptions.getFetchMode() == FetchOptions.FetchMode.LAZY) {
         DocumentExtractor extractor = hSearchQuery.queryDocumentExtractor();   //triggers actual Lucene search
         return filterNulls(new LazyIterator(extractor, getResultLoader(), fetchOptions.getFetchSize()));
      } else {
         throw new IllegalArgumentException("Unknown FetchMode " + fetchOptions.getFetchMode());
      }
   }
View Full Code Here

  @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

Related Classes of org.hibernate.search.query.engine.spi.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.