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 IteratorResultSet
EMPTY_ITERATOR_RESULT_SET
static IteratorSearchResponse
EMPTY_ITERATOR_SEARCH_RESPONSE
Deprecated.Useempty(Query)
instead.private IteratorResultSet
results
static 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.
-
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 void
close()
Frees any resource associated with this response.static IteratorSearchResponse
empty(org.apache.lucene.search.Query q)
IteratorResultSet
getResults()
int
getTotalProcessedArtifactInfoCount()
A helper method delegating the call to the IteratorResultSet.IteratorResultSet
iterator()
-
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:
iterator
in interfacejava.lang.Iterable<ArtifactInfo>
-
close
public void close() throws java.io.IOException
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in 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)
-
-