public class FieldIndexerWithStats extends Object implements FieldIndexer
Modifier and Type | Class and Description |
---|---|
static class |
FieldIndexerWithStats.Stats |
LABELS_NO_VALUE_INDEX_VALUE, NO_VALUE_INDEX_VALUE
Modifier and Type | Method and Description |
---|---|
void |
addIndex(org.apache.lucene.document.Document doc,
Issue issue)
This method allows an indexer the opportunity to modify the provided Lucene document (by reference) such
that it will contain fields that are relevant for searching and storage of the portion of the issue that
the FieldIndexer handles.
|
static FieldIndexerWithStats |
createKnown(FieldIndexer delegate) |
static FieldIndexerWithStats |
createOther(FieldIndexer delegate) |
boolean |
equals(Object o) |
String |
getDocumentFieldId() |
String |
getId() |
int |
hashCode() |
boolean |
isFieldVisibleAndInScope(Issue issue)
This method is used to determine if the indexer is relevant for the provided issue.
|
FieldIndexerWithStats |
overrideTicker(com.google.common.base.Ticker ticker) |
void |
reset() |
FieldIndexerWithStats.Stats |
resetSnapshot() |
FieldIndexerWithStats.Stats |
stats() |
String |
toString() |
public FieldIndexerWithStats overrideTicker(com.google.common.base.Ticker ticker)
public static FieldIndexerWithStats createKnown(FieldIndexer delegate)
public static FieldIndexerWithStats createOther(FieldIndexer delegate)
public String getId()
getId
in interface FieldIndexer
public String getDocumentFieldId()
getDocumentFieldId
in interface FieldIndexer
Document
as a result of a successful call to the
FieldIndexer.addIndex(org.apache.lucene.document.Document, com.atlassian.jira.issue.Issue)
method.public void addIndex(org.apache.lucene.document.Document doc, Issue issue)
FieldIndexer
If calling FieldIndexer.isFieldVisibleAndInScope(com.atlassian.jira.issue.Issue)
returns false then
this method should create fields that have an Indexed type of org.apache.lucene.document.Field.Index#NO
.
This allows us to store the value in the index but renders its value unsearchable.
If, for example, the indexer handles indexing an issues summary then this indexer will add a field to the document that represents the stored and searchable summary of the issue.
addIndex
in interface FieldIndexer
doc
- the lucene document that should be modified by adding relevant fields to.issue
- the issue that contains the data that will be indexed and which can be used to determine
the project/issue type context that will allow you to determine if we should add the value as searchable
or unsearchable.public boolean isFieldVisibleAndInScope(Issue issue)
FieldIndexer
All these checks should take into account the IssueContext
as defined by
the passed in issue.
If this method returns false then the FieldIndexer, when performing addIndex, should make sure to make the
indexed values have an Indexed type of org.apache.lucene.document.Field.Index#NO
.
The result of this method is used to determine the correct values that should be returned when performing an empty search.
isFieldVisibleAndInScope
in interface FieldIndexer
issue
- that is having a document created from.public FieldIndexerWithStats.Stats stats()
public FieldIndexerWithStats.Stats resetSnapshot()
public void reset()
Copyright © 2002-2019 Atlassian. All Rights Reserved.