Hi,
I want to make my customfield searchable with the normal version search. I found some tutorials but they didnt work for me. (Modifying the pom.xml to associate the cftype with the searcher. But still after installing my plugin (and later reindexing and restart jira) it was not shown in the issue navigator).
The tutorial I tried:
http://www.j-tricks.com/1/post/2010/09/custom-field-searchers.html
Someone had the same problem and knows a solution ? Or is there another tutorial I missed?
Greets,
Mokuyobi
I am using jira 5.0.7 .
Below code will work.
public class CustomVersionSearcher extends VersionSearcher {
public CustomVersionSearcher(VersionManager versionManager,
FieldVisibilityManager fieldVisibilityManager,
JqlOperandResolver operandResolver,
PermissionManager permissionManager, CustomFieldInputHelper customFieldInputHelper) {
super(versionManager, fieldVisibilityManager, new VersionResolver(versionManager), operandResolver,
new DefaultFieldFlagOperandRegistry() , new VersionClauseContextFactory(operandResolver, new VersionResolver(versionManager), permissionManager) ,
permissionManager, ContextSetUtil.getInstance(), ComponentAccessor.getComponent(FieldConfigSchemeClauseContextUtil.class) , new MultiClauseDecoratorContextFactory.Factory( new DefaultOperatorUsageValidator(operandResolver, ComponentAccessor.getI18nHelperFactory()) , operandResolver, ContextSetUtil.getInstance()),
customFieldInputHelper);
}
Has anyone used this and also changed how the indexer stores the data in the lucene index by overriding the init function? I keep getting an error that the variable for the DefaultFieldFlagOperandRegistry is null in this code line. this.searchInputTransformer = new VersionPickerCustomFieldSearchInputTransformer(field, operandResolver, fieldFlagOperandRegistry, versionResolver, customFieldInputHelper); fieldFlagOperandRegistry is null because it is never initialized by using the super call in the constructor. I am not sure how to initialize this value. Any pointers? This is my init function and I use the super constructor listed above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public void init(CustomField field) { super.init(field); final ToggleVersionCustomFieldIndexer indexer = new ToggleVersionCustomFieldIndexer(fieldVisibilityManager, field); this.searcherInformation = new CustomFieldSearcherInformation(field.getId(), field.getNameKey(), Collections.<FieldIndexer>singletonList(indexer), new AtomicReference<CustomField>(field)); this.searchRenderer = new VersionPickerCustomFieldRenderer(field, projectManager, versionManager, fieldVisibilityManager, velocityRequestContextFactory, applicationProperties, templatingEngine, permissionManager, searcherInformation.getNameKey()); this.searchInputTransformer = new VersionPickerCustomFieldSearchInputTransformer(field, operandResolver, fieldFlagOperandRegistry, versionResolver, customFieldInputHelper); this.customFieldSearcherClauseHandler = new SimpleCustomFieldContextValueGeneratingClauseHandler( new VersionCustomFieldValidator(versionResolver, operandResolver, permissionManager, versionManager, beanFactory), new VersionCustomFieldClauseQueryFactory(field.getId(), versionResolver, operandResolver), new IntersectingClauseContextFactory(contextSetUtil, CollectionBuilder.newBuilder( new CustomFieldClauseContextFactory(field, clauseContextUtil, ContextSetUtil.getInstance()), versionClauseContextFactory).asList()), new VersionClauseValuesGenerator(versionManager, permissionManager, beanFactory), OperatorClasses.EQUALITY_AND_RELATIONAL_WITH_EMPTY, JiraDataTypes.VERSION); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After modifying the plugin, did you edit the custom field and apply that searcher?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just found out that it works if I use the TextSearcher. But I want to use the VersionSearcher. If I extend the Version Searcher it doesnt work and the plugin disables itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.