Package org.apache.maven.index
Class IteratorSearchResponse
- java.lang.Object
-
- org.apache.maven.index.AbstractSearchResponse
-
- org.apache.maven.index.IteratorSearchResponse
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Iterable<ArtifactInfo>
public class IteratorSearchResponse extends AbstractSearchResponse implements java.lang.Iterable<ArtifactInfo>, java.io.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.
-
-
Field Summary
Fields Modifier and Type Field Description static IteratorResultSetEMPTY_ITERATOR_RESULT_SETstatic IteratorSearchResponseEMPTY_ITERATOR_SEARCH_RESPONSEDeprecated.Useempty(Query)instead.private IteratorResultSetresultsstatic IteratorSearchResponseTOO_MANY_HITS_ITERATOR_SEARCH_RESPONSEDeprecated.Left here for backward compatibility, but since version 4.1.0 (see MINDEXER-14) there is NO notion of "hit limit" anymore.
-
Constructor Summary
Constructors Constructor Description IteratorSearchResponse(org.apache.lucene.search.Query query, int totalHits, IteratorResultSet results)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Frees any resource associated with this response.static IteratorSearchResponseempty(org.apache.lucene.search.Query q)IteratorResultSetgetResults()intgetTotalProcessedArtifactInfoCount()A helper method delegating the call to the IteratorResultSet.IteratorResultSetiterator()-
Methods inherited from class org.apache.maven.index.AbstractSearchResponse
getQuery, getReturnedHitsCount, getTotalHits, getTotalHitsCount, isHitLimitExceeded
-
-
-
-
Field Detail
-
results
private final IteratorResultSet results
-
EMPTY_ITERATOR_RESULT_SET
public static final IteratorResultSet EMPTY_ITERATOR_RESULT_SET
-
EMPTY_ITERATOR_SEARCH_RESPONSE
public static final IteratorSearchResponse EMPTY_ITERATOR_SEARCH_RESPONSE
Deprecated.Useempty(Query)instead.Empty search response.
-
TOO_MANY_HITS_ITERATOR_SEARCH_RESPONSE
public static final IteratorSearchResponse 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 Detail
-
IteratorSearchResponse
public IteratorSearchResponse(org.apache.lucene.search.Query query, int totalHits, IteratorResultSet results)
-
-
Method Detail
-
getResults
public IteratorResultSet getResults()
-
iterator
public IteratorResultSet iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<ArtifactInfo>
-
close
public void close() throws java.io.IOExceptionDescription copied from class:AbstractSearchResponseFrees any resource associated with this response. Should be called as last method on this response, when it's not used anymore.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classAbstractSearchResponse- Throws:
java.io.IOException
-
getTotalProcessedArtifactInfoCount
public int getTotalProcessedArtifactInfoCount()
A helper method delegating the call to the IteratorResultSet.- Returns:
-
empty
public static final IteratorSearchResponse empty(org.apache.lucene.search.Query q)
-
-