Custom Field Searchable is not working

I am trying to implement a simple Test Searcher for my custom field but it does not work.

Here is a part of atlassian-plugin.xml.

    <customfield-type name="My Custom Field" i18n-name-key="my-custom-field.name" key="my-custom-field"
                      class="com.example.jira.customfields.MyCustomField">
        <description key="my-custom-field.description">The My Custom Field Plugin</description>
        <resource name="view" type="velocity" location="/templates/customfields/my-custom-field/view.vm"/>
        <resource name="edit" type="velocity" location="/templates/customfields/my-custom-field/edit.vm"/>
    </customfield-type>
    <customfield-searcher name="Text Searcher" i18n-name-key="text-searcher.name" key="text-searcher"
                          class="com.atlassian.jira.issue.customfields.searchers.TextSearcher">
        <description key="text-searcher.description">The Text Searcher Plugin</description>
        <valid-customfield-type package="com.example" key="my-custom-field"/>
        <resource name="search" type="velocity" location="/templates/customfields/text-searcher/search.vm"/>
    </customfield-searcher>

This is MyCustomField.java

package com.example.jira.customfields;

import com.atlassian.jira.issue.customfields.impl.GenericTextCFType;
import com.atlassian.jira.issue.customfields.manager.GenericConfigManager;
import com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister;
import com.atlassian.jira.issue.customfields.persistence.PersistenceFieldType;
import com.atlassian.jira.issue.fields.TextFieldCharacterLengthValidator;
import com.atlassian.jira.security.JiraAuthenticationContext;
import com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport;

public class MyCustomField extends GenericTextCFType {

    public MyCustomField(@JiraImport CustomFieldValuePersister customFieldValuePersister, @JiraImport GenericConfigManager genericConfigManager, @JiraImport TextFieldCharacterLengthValidator textFieldCharacterLengthValidator, @JiraImport JiraAuthenticationContext jiraAuthenticationContext) {
        super(customFieldValuePersister, genericConfigManager, textFieldCharacterLengthValidator, jiraAuthenticationContext);
    }

    @Override
    protected PersistenceFieldType getDatabaseType() {
        return PersistenceFieldType.TYPE_UNLIMITED_TEXT;
    }
}

After uploading the plugin, it shows a ‘no search temple’ message.

gut so

Hello @ChandanKumar I have the same problem as you. Were you able to solve this?

To get started, I’m not even trying my own searcher, and instead tried using the default system searcher:

<customfield-type key="myfield" name="testname" i18n-name-key="my.basic.label" class="com.example.fields.MyCustomField">
    <description key="my.description"></description>
    <resource type="velocity" name="view" location="/templates/mystuff/folder/basic/view.vm"/>
    <resource type="velocity" name="edit" location="/templates/mystuff/folder/basic/edit.vm"/>
    <resource type="velocity" name="xml" location="/templates/mystuff/folder/basic/xml.vm"/>
</customfield-type>


...


<customfield-searcher key="textsearcher" name="A Text Searcher"
                      i18n-name-key="admin.customfield.searcher.textsearcher.name"
                      class="com.atlassian.jira.issue.customfields.searchers.TextSearcher">
    <description key="admin.customfield.searcher.textsearcher.desc">blah blah.</description>

    <resource type="velocity" name="search" location="templates/plugins/fields/edit-searcher
       /search-basictext.vm"/>
    <resource type="velocity" name="view" location="templates/plugins/fields/view-searcher
       /view-searcher-basictext.vm"/>
    <valid-customfield-type package="com.example.fields" key="myfield"/>
</customfield-searcher>

Just like in the examples I found. Yet, I can’t get a searcher to appear for my field using that method.

—>> For me, I found a solution to use Atlassian default text searcher:
Add this to the custom field definition:

    <valid-searcher
            package="com.atlassian.jira.plugin.system.customfieldtypes"
            key="textsearcher"/>

Then I commented out my <customfield-searcher>. That’s all I needed to do to use the default searcher, and I don’t think I really need a custom one.