public class DefaultIteratorResultSet extends java.lang.Object implements IteratorResultSet
Modifier and Type | Field and Description |
---|---|
private ArtifactInfo |
ai |
private boolean |
cleanedUp |
private java.util.List<IndexingContext> |
contexts |
private int |
count |
private ArtifactInfoFilter |
filter |
private int |
from |
private org.apache.lucene.search.TopDocs |
hits |
private NexusIndexMultiSearcher |
indexSearcher |
private java.util.List<MatchHighlightRequest> |
matchHighlightRequests |
private int |
maxRecPointer |
private int |
pointer |
private ArtifactInfoPostprocessor |
postprocessor |
private int |
processedArtifactInfoCount |
private IteratorSearchRequest |
searchRequest |
private int[] |
starts |
Modifier | Constructor and Description |
---|---|
protected |
DefaultIteratorResultSet(IteratorSearchRequest request,
NexusIndexMultiSearcher indexSearcher,
java.util.List<IndexingContext> contexts,
org.apache.lucene.search.TopDocs hits) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateHighlights(IndexingContext context,
org.apache.lucene.document.Document d,
ArtifactInfo ai)
Creates the MatchHighlights and adds them to ArtifactInfo if found/can.
|
protected void |
cleanUp() |
void |
close() |
protected ArtifactInfo |
createNextAi() |
void |
finalize() |
protected java.util.List<java.lang.String> |
getBestFragments(org.apache.lucene.search.Query query,
org.apache.lucene.search.highlight.Formatter formatter,
org.apache.lucene.analysis.TokenStream tokenStream,
java.lang.String text,
int maxNumFragments) |
protected IndexingContext |
getIndexingContextForPointer(org.apache.lucene.document.Document doc,
int docPtr) |
int |
getTotalProcessedArtifactInfoCount()
Returns the up-to-date number of the actual number of loaded Lucene Documents that were converted into
ArtifactInfo object until last next() invocation.
|
boolean |
hasNext() |
protected java.util.List<java.lang.String> |
highlightField(IndexingContext context,
MatchHighlightRequest hr,
IndexerField field,
java.lang.String text)
Returns a string that contains match fragment highlighted in style as user requested.
|
java.util.Iterator<ArtifactInfo> |
iterator() |
ArtifactInfo |
next() |
private static int |
readerIndex(int n,
int[] starts,
int numSubReaders) |
void |
remove() |
protected IndexerField |
selectStoredIndexerField(Field field)
Select a STORED IndexerField assigned to passed in Field.
|
private final IteratorSearchRequest searchRequest
private final NexusIndexMultiSearcher indexSearcher
private final java.util.List<IndexingContext> contexts
private final int[] starts
private final ArtifactInfoFilter filter
private final ArtifactInfoPostprocessor postprocessor
private final java.util.List<MatchHighlightRequest> matchHighlightRequests
private final org.apache.lucene.search.TopDocs hits
private final int from
private final int count
private final int maxRecPointer
private int pointer
private int processedArtifactInfoCount
private ArtifactInfo ai
private volatile boolean cleanedUp
protected DefaultIteratorResultSet(IteratorSearchRequest request, NexusIndexMultiSearcher indexSearcher, java.util.List<IndexingContext> contexts, org.apache.lucene.search.TopDocs hits) throws java.io.IOException
java.io.IOException
public boolean hasNext()
hasNext
in interface java.util.Iterator<ArtifactInfo>
public ArtifactInfo next()
next
in interface java.util.Iterator<ArtifactInfo>
public void remove()
remove
in interface java.util.Iterator<ArtifactInfo>
public java.util.Iterator<ArtifactInfo> iterator()
iterator
in interface java.lang.Iterable<ArtifactInfo>
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public int getTotalProcessedArtifactInfoCount()
IteratorResultSet
getTotalProcessedArtifactInfoCount
in interface IteratorResultSet
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected ArtifactInfo createNextAi() throws java.io.IOException
java.io.IOException
protected void cleanUp()
protected void calculateHighlights(IndexingContext context, org.apache.lucene.document.Document d, ArtifactInfo ai) throws java.io.IOException
context
- d
- ai
- java.io.IOException
protected IndexerField selectStoredIndexerField(Field field)
field
- protected java.util.List<java.lang.String> highlightField(IndexingContext context, MatchHighlightRequest hr, IndexerField field, java.lang.String text) throws java.io.IOException
context
- hr
- field
- text
- java.io.IOException
protected final java.util.List<java.lang.String> getBestFragments(org.apache.lucene.search.Query query, org.apache.lucene.search.highlight.Formatter formatter, org.apache.lucene.analysis.TokenStream tokenStream, java.lang.String text, int maxNumFragments) throws java.io.IOException
java.io.IOException
protected IndexingContext getIndexingContextForPointer(org.apache.lucene.document.Document doc, int docPtr)
private static int readerIndex(int n, int[] starts, int numSubReaders)