@PublicSpi public abstract class AbstractCustomFieldIndexer extends Object implements FieldIndexer
| Modifier and Type | Field and Description |
|---|---|
protected CustomField |
customField |
LABELS_NO_VALUE_INDEX_VALUE, NO_VALUE_INDEX_VALUE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCustomFieldIndexer(FieldVisibilityManager fieldVisibilityManager,
CustomField customField) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDocumentFieldsNotSearchable(org.apache.lucene.document.Document doc,
Issue issue)
Deprecated.
since 8.10 implement
addDocumentFieldsNotSearchable(Document, Issue, CustomFieldPrefetchedData) instead |
protected void |
addDocumentFieldsNotSearchable(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData)
Deprecated.
since 8.12 implement
addDocumentFieldsNotSearchable(Document, Issue, CustomFieldPrefetchedData) instead |
protected void |
addDocumentFieldsNotSearchable(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData) |
void |
addDocumentFieldsSearchable(org.apache.lucene.document.Document doc,
Issue issue)
Deprecated.
since 8.10 implement
addDocumentFieldsSearchable(Document, Issue, CustomFieldPrefetchedData) instead |
protected void |
addDocumentFieldsSearchable(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData)
Deprecated.
since 8.12 implement
addDocumentFieldsNotSearchable(Document, Issue, CustomFieldPrefetchedData) instead |
protected void |
addDocumentFieldsSearchable(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData) |
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.
|
void |
addIndex(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData) |
void |
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.
|
String |
getDocumentFieldId() |
String |
getId() |
boolean |
isFieldVisibleAndInScope(Issue issue)
This method is used to determine if the indexer is relevant for the provided issue.
|
protected boolean |
isRelevantForIssue(Issue issue) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitskipsIndexingNullprotected final CustomField customField
protected AbstractCustomFieldIndexer(FieldVisibilityManager fieldVisibilityManager, CustomField customField)
public String getId()
getId in interface FieldIndexerpublic String getDocumentFieldId()
getDocumentFieldId in interface FieldIndexerDocument as a result of a successful call to the
FieldIndexer.addIndex(Document, Issue, CustomFieldPrefetchedData) method.@Deprecated public void addDocumentFieldsSearchable(org.apache.lucene.document.Document doc, Issue issue)
addDocumentFieldsSearchable(Document, Issue, CustomFieldPrefetchedData) instead@Deprecated public void addDocumentFieldsNotSearchable(org.apache.lucene.document.Document doc, Issue issue)
addDocumentFieldsNotSearchable(Document, Issue, CustomFieldPrefetchedData) instead@Deprecated protected void addDocumentFieldsSearchable(org.apache.lucene.document.Document doc, Issue issue, CustomFieldPrefetchedData prefetchedData)
addDocumentFieldsNotSearchable(Document, Issue, CustomFieldPrefetchedData) instead@Deprecated protected void addDocumentFieldsNotSearchable(org.apache.lucene.document.Document doc, Issue issue, CustomFieldPrefetchedData prefetchedData)
addDocumentFieldsNotSearchable(Document, Issue, CustomFieldPrefetchedData) insteadprotected void addDocumentFieldsSearchable(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData)
protected void addDocumentFieldsNotSearchable(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData)
public final 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.
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.
addIndex in interface FieldIndexerdoc - 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 void addIndex(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData)
addIndex in interface FieldIndexerpublic void addIndex(org.apache.lucene.document.Document doc,
Issue issue,
CustomFieldPrefetchedData prefetchedData)
FieldIndexer
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.
addIndex in interface FieldIndexerdoc - 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>)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 FieldIndexerissue - that is having a document created from.protected boolean isRelevantForIssue(Issue issue)
Copyright © 2002-2024 Atlassian. All Rights Reserved.