com.atlassian.jira.issue.search.LuceneFieldSorter<T> |
Clients of @PublicSpi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicSpi
as per each product's API policy (clients should refer to each product's API policy for
the exact guarantee -- usually binary compatibility is guaranteed at least across minor versions).
@PublicSpi
interfaces and classes are specifically designed to be implemented/extended by clients.
Hence, the guarantee of binary compatibility is different to that of @PublicApi
elements (if an element
is both @PublicApi
and @PublicSpi
, both guarantees apply).
Implementations of this interface are used to sort Lucene search results of Issue Documents.
NOTE: instances of this interface are cached by Lucene and are REUSED to sort multiple Lucene search results. The Comparator returned by thegetComparator()
method could be used by Lucene from multiple threads at once.
Therefore, the implementations of this interface MUST implement the equals(Object)
and hashCode()
methods correctly to ensure that Lucene can find the implementations of this class
in its cache and reuse it, rather than make the cache grow indefinitely. (Unfortunately the Lucene cache is rather
primitive at the moment, and is not bound).
Also, ensure that the Comparator
returned by the getComparator()
method is thread
safe.
As instances of this and the Comparator
returned by this object are cached and reused by Lucene to sort
multiple search results, the best thing to do is to ensure the implementations of this interface and the
Comparator
that is returned are immutable and that the equals(Object)
and
hashCode()
methods respect the state of the object.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
As this object is used as a key in a cache, this method must be provided and respect all internal state.
| |||||||||||
A comparator that can be used to order objects returned by
getValueFromLuceneField(String) . | |||||||||||
Get the constant that this field is indexed with.
| |||||||||||
Convert the lucene document field back to the object that you wish to use to display it.
| |||||||||||
As this object is used as a key in a cache, this method must be provided and respect all internal state.
|
As this object is used as a key in a cache, this method must be provided and respect all internal state.
See the class javadoc entry for more details.A comparator that can be used to order objects returned by getValueFromLuceneField(String)
.
Get the constant that this field is indexed with.
CustomFieldSearcher
Convert the lucene document field back to the object that you wish to use to display it.
eg. '1000' -> Version 1.
This does the reverse of what com.atlassian.jira.issue.index.IssueDocument does.
For custom fields, the return value will be passed to
getStatHtml(com.atlassian.jira.issue.fields.CustomField, Object, String)
documentValue | The value of the field in the lucene index |
---|
As this object is used as a key in a cache, this method must be provided and respect all internal state.
See the class javadoc entry for more details.