Package org.apache.maven.index
Class IteratorSearchResponse
java.lang.Object
org.apache.maven.index.AbstractSearchResponse
org.apache.maven.index.IteratorSearchResponse
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<ArtifactInfo>
public class IteratorSearchResponse
extends AbstractSearchResponse
implements Iterable<ArtifactInfo>, Closeable
A Search Response for the "iterator-like" search request. The totalHitsCount reports total hits found on
index, even if the set of ArtifactInfos are usually limited! On the flipside, the hitsCount is actually unknown,
since this instance performs filtering on the fly, hence it does not know how many hits it will return ahead of time.
- Author:
- cstamas
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IteratorResultSet
static final IteratorSearchResponse
Deprecated.static final IteratorSearchResponse
Deprecated.Left here for backward compatibility, but since version 4.1.0 (see MINDEXER-14) there is NO notion of "hit limit" anymore. -
Constructor Summary
ConstructorDescriptionIteratorSearchResponse
(org.apache.lucene.search.Query query, int totalHits, IteratorResultSet results) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Frees any resource associated with this response.static IteratorSearchResponse
empty
(org.apache.lucene.search.Query q) int
A helper method delegating the call to the IteratorResultSet.iterator()
Methods inherited from class org.apache.maven.index.AbstractSearchResponse
getQuery, getReturnedHitsCount, getTotalHits, getTotalHitsCount, isHitLimitExceeded
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY_ITERATOR_RESULT_SET
-
EMPTY_ITERATOR_SEARCH_RESPONSE
Deprecated.Useempty(Query)
instead.Empty search response. -
TOO_MANY_HITS_ITERATOR_SEARCH_RESPONSE
Deprecated.Left here for backward compatibility, but since version 4.1.0 (see MINDEXER-14) there is NO notion of "hit limit" anymore.Too many search response.
-
-
Constructor Details
-
IteratorSearchResponse
public IteratorSearchResponse(org.apache.lucene.search.Query query, int totalHits, IteratorResultSet results)
-
-
Method Details
-
getResults
-
iterator
- Specified by:
iterator
in interfaceIterable<ArtifactInfo>
-
close
Description copied from class:AbstractSearchResponse
Frees any resource associated with this response. Should be called as last method on this response, when it's not used anymore.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractSearchResponse
- Throws:
IOException
-
getTotalProcessedArtifactInfoCount
public int getTotalProcessedArtifactInfoCount()A helper method delegating the call to the IteratorResultSet.- Returns:
-
empty
-
empty(Query)
instead.