Class FeatureFlagGuardedFieldIndexerWithStats

java.lang.Object
com.atlassian.jira.issue.index.indexers.FieldIndexerWithStats
com.atlassian.jira.issue.index.indexers.FeatureFlagGuardedFieldIndexerWithStats
All Implemented Interfaces:
FieldIndexer, FieldIndexerStatsCollector

@Deprecated(since="10.5", forRemoval=true) public class FeatureFlagGuardedFieldIndexerWithStats extends FieldIndexerWithStats
Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • FeatureFlagGuardedFieldIndexerWithStats

      protected FeatureFlagGuardedFieldIndexerWithStats(boolean isKnown, FieldIndexer delegate, IndexingFeatures indexingFeatures)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • createKnown

      public static FeatureFlagGuardedFieldIndexerWithStats createKnown(FieldIndexer delegate, IndexingFeatures indexingFeatures)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • createOther

      public static FeatureFlagGuardedFieldIndexerWithStats createOther(FieldIndexer delegate, IndexingFeatures indexingFeatures)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addIndex

      public void addIndex(org.apache.lucene.document.Document doc, Issue issue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 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.

      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.
    • addIndex

      public void addIndex(org.apache.lucene.document.Document doc, Issue issue, CustomFieldPrefetchedData prefetchedData)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 have FieldType.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.

      Specified by:
      addIndex in interface FieldIndexer
      Overrides:
      addIndex in class FieldIndexerWithStats
      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 implemented CustomFieldType.getNonNullCustomFieldProvider() this reference will hold the matching value returned from NonNullCustomFieldProvider.getCustomFieldInfo(List <Issue>)
    • isFieldVisibleAndInScope

      public boolean isFieldVisibleAndInScope(Issue issue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: FieldIndexer
      This 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 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.

      Specified by:
      isFieldVisibleAndInScope in interface FieldIndexer
      Overrides:
      isFieldVisibleAndInScope in class FieldIndexerWithStats
      Parameters:
      issue - that is having a document created from.
      Returns:
      if true then this field is relevant for the issue, otherwise it is not.