Class NumberCustomFieldIndexer
java.lang.Object
com.atlassian.jira.search.issue.index.indexers.impl.NumberCustomFieldIndexer
- All Implemented Interfaces:
CustomFieldIndexer,FieldIndexer
@PublicApi
public class NumberCustomFieldIndexer
extends Object
implements CustomFieldIndexer, FieldIndexer
Field indexer for number custom fields
- Since:
- 10.4
-
Field Summary
FieldsFields inherited from interface com.atlassian.jira.search.issue.index.indexers.FieldIndexer
LABELS_NO_VALUE_INDEX_VALUE, NO_VALUE_INDEX_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionNumberCustomFieldIndexer(FieldVisibilityManager fieldVisibilityManager, CustomField customField, boolean skipsIndexingNull) -
Method Summary
Modifier and TypeMethodDescriptionReturns the custom field associated with this indexerDeclares the fields to be added to the index schemagetId()voidindexFields(FieldValueCollector collector, Issue issue, CustomFieldPrefetchedData prefetchedData) This method allows an indexer the opportunity to add values to the provided collector that are relevant for searching and storage of the portion of the issue that the FieldIndexer handles.voidindexFieldsWithVisibility(FieldValueCollector collector, Issue issue, CustomFieldPrefetchedData prefetchedData, boolean visible) The same as indexField but accepts an additional parameter to indicate if the field is visible and in scope.booleanisFieldVisibleAndInScope(Issue issue) This method is used to determine if the indexer is relevant for the provided issue.booleanUsed to declare how the indexer handles nulls.
-
Field Details
-
fieldVisibilityManager
-
-
Constructor Details
-
NumberCustomFieldIndexer
public NumberCustomFieldIndexer(FieldVisibilityManager fieldVisibilityManager, CustomField customField, boolean skipsIndexingNull)
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceFieldIndexer- 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.
-
isFieldVisibleAndInScope
Description copied from interface:FieldIndexerThis method is used to determine if the indexer is relevant for the provided issue. This method must check the fields visibility, in relation to the field configuration scheme, must check any global flags that would enable or disable a field (such as enable votes flag), and must check, if the field is a custom field, if the custom field is relevant for this issue.All these checks should take into account the
IssueContextas defined by the passed in issue.The result of this method is used to determine the correct values that should be returned when performing an empty search.
- Specified by:
isFieldVisibleAndInScopein interfaceFieldIndexer- Parameters:
issue- that is having a document created from.- Returns:
- if true then this field is relevant for the issue, otherwise it is not.
-
getCustomField
Description copied from interface:CustomFieldIndexerReturns the custom field associated with this indexer- Specified by:
getCustomFieldin interfaceCustomFieldIndexer- Returns:
- CustomField
-
indexFields
public void indexFields(FieldValueCollector collector, Issue issue, CustomFieldPrefetchedData prefetchedData) Description copied from interface:FieldIndexerThis method allows an indexer the opportunity to add values to the provided collector that are relevant for searching and storage of the portion of the issue that the FieldIndexer handles.If, for example, the indexer handles indexing an issues summary then this indexer will add a field value to the collector 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
KeywordFieldwill result in them being removed to prevent the indexing operation from crashing. This is a limitation of how OpenSearch and Lucene store terms.- Specified by:
indexFieldsin interfaceFieldIndexer- Parameters:
collector- the collector for collecting indexed valuesissue- 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>)
-
indexFieldsWithVisibility
public void indexFieldsWithVisibility(FieldValueCollector collector, Issue issue, CustomFieldPrefetchedData prefetchedData, boolean visible) Description copied from interface:FieldIndexerThe same as indexField but accepts an additional parameter to indicate if the field is visible and in scope. Thanks to that there is no need to callFieldIndexer.isFieldVisibleAndInScope(Issue)method inside. The default implementation is for backward compatibility. An indexer that wants to take advantage of performance gain should implement FieldWithVisibilityIndexer interface- Specified by:
indexFieldsWithVisibilityin interfaceFieldIndexer- Parameters:
collector- the collector for collecting indexed valuesissue- that is having a document created from.prefetchedData- if the custom field type implementedCustomFieldType.getNonNullCustomFieldProvider()this reference will hold the matching value returned fromNonNullCustomFieldProvider.getCustomFieldInfo(List <Issue>)*
-
getFields
Description copied from interface:FieldIndexerDeclares the fields to be added to the index schema- Specified by:
getFieldsin interfaceFieldIndexer
-
skipsIndexingNull
public boolean skipsIndexingNull()Description copied from interface:FieldIndexerUsed to declare how the indexer handles nulls.- Specified by:
skipsIndexingNullin interfaceFieldIndexer- Returns:
- true if the indexer doesn't do anything when the field value is null
-