java.lang.Object |
↳ |
com.atlassian.jira.issue.search.parameters.lucene.sort.DefaultMatchHandler |
This class is considered usable by external developers but its contracts have not stabilized.
Experimental APIs may be changed at any time before being marked
@Internal
or
@PublicApi
.
Class Overview
The default match handler used by getMatches(org.apache.lucene.index.IndexReader, String)
.
Builds an array of collections of strings, where the array index is
the document number and the collection contains the values for that
term. In JIRA's terms, the array index is a key for looking up an
issue and the collection contains the values assigned to the field
we are matching against.
This array built here is a memory eating monster and we take special care to eat as little as possible.
This matcher labours under the assumption that nearly all documents have single values for most terms,
even in the case of multi-valued fields, such as component or fixVersion, most documents have only a single value,
often the empty value, "-1".
We use a shared singleton for any single values and only build a mutable collection once we go past a single value.
This has no performance cost even in the case where there are > 1 values, aside from the size() == 1 comparison.
Public Constructors
public
DefaultMatchHandler
(int maxdoc)
Public Methods
public
void
handleMatchedDocument
(int doc, String termValue)
Parameters
doc
| the document identifier for the document that contains the term. In
JIRA, this indentifies a particular issue |
termValue
| the value assigned to the term. In JIRA, this is the value
assigned to the field.
|