Class LabelsIndexer
java.lang.Object
com.atlassian.jira.issue.index.indexers.impl.BaseFieldIndexer
com.atlassian.jira.issue.index.indexers.impl.LabelsIndexer
- All Implemented Interfaces:
FieldIndexer
Responsible for adding fields to the Issue document being indexed.
- Since:
- 4.2
-
Field Summary
Fields inherited from class com.atlassian.jira.issue.index.indexers.impl.BaseFieldIndexer
fieldVisibilityManager
Fields inherited from interface com.atlassian.jira.issue.index.indexers.FieldIndexer
LABELS_NO_VALUE_INDEX_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIndex
(org.apache.lucene.document.Document doc, Issue issue, CustomFieldPrefetchedData prefetchedData) 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.getId()
Methods inherited from class com.atlassian.jira.issue.index.indexers.impl.BaseFieldIndexer
compareTo, equals, hashCode, indexDateField, indexDependentEntities, indexFoldedKeyword, indexKeyword, indexKeywords, indexKeywordWithDefault, indexKeywordWithDefault, indexLocalDateField, indexLongAsKeyword, indexLongAsPaddedKeywordWithDefault, indexLongAsPaddedKeywordWithDefault, indexText, indexTextForSorting, isFieldVisibleAndInScope
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.issue.index.indexers.FieldIndexer
addIndex, skipsIndexingNull
-
Field Details
-
NO_VALUE_INDEX_VALUE
- See Also:
-
-
Constructor Details
-
LabelsIndexer
-
-
Method Details
-
getId
- Returns:
- the String representation of the field id that this indexer is indexing, this must be unique for each independent FieldIndexer. If the Indexer does not represent a System or Custom field in JIRA this should still return a unique string that describes the indexer.
-
getDocumentFieldId
- Returns:
- the String representation of the primary field id that will be added to the
Document
as a result of a successful call to theFieldIndexer.addIndex(Document, Issue, CustomFieldPrefetchedData)
method.
-
addIndex
public void addIndex(org.apache.lucene.document.Document doc, Issue issue, CustomFieldPrefetchedData prefetchedData) Description copied from interface:FieldIndexer
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.If calling
FieldIndexer.isFieldVisibleAndInScope(com.atlassian.jira.issue.Issue)
returns false then this method should create fields that haveFieldType.stored()
} property set to true. 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.
Note that trying to index very large (i.e. larger than ~32 kB) fields as StringFields or DocValues will result in them being removed to prevent the indexing operation from crashing. This is a limitation of how Lucene stores terms and DocValues.
- Parameters:
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.prefetchedData
- if the custom field type implementedCustomFieldType.getNonNullCustomFieldProvider()
this reference will hold the matching value returned fromNonNullCustomFieldProvider.getCustomFieldInfo(List <Issue>)
-