Create custom field type search

Hi, I am creating my own custom type of digital field, the problem is that my type does not work in search
Field ‘cf[24001]’ is not searchable, it is only sortable.

 <customfield-searcher key="exactnumbertest" name="Number Searcher test" class="com.mycompany.plugins.view.CustomFieldSearch">
        <description key="admin.customfield.searcher.exactnumber.desctest">Allow searching for a number which exactly matches.</description>

        <resource type="velocity" name="search" location="/templates/com/mycompany/plugins/search.vm"/>
        <resource type="velocity" name="view" location="/templates/com/mycompany/plugins/view-searcher.vm"/>
        <valid-customfield-type package="com.atlassian.jira.plugin.system.customfieldtypes" key="float"/>
        <valid-customfield-type package="com.atlassian.jira.plugin.system.customfieldtypes" key="importid"/>
    </customfield-searcher>
public class CustomFieldSearch extends ExactNumberSearcher {
    public CustomFieldSearch(@ComponentImport FieldVisibilityManager fieldVisibilityManager, @ComponentImport JqlOperandResolver jqlOperandResolver,@ComponentImport DoubleConverter doubleConverter,@ComponentImport CustomFieldInputHelper customFieldInputHelper,@ComponentImport I18nHelper.BeanFactory beanFactory) {
        super(fieldVisibilityManager, jqlOperandResolver, doubleConverter, customFieldInputHelper, beanFactory);
    }

    @Override
    public void init(CustomField field) {
        super.init(field);
    }

    @Override
    public SearcherInformation<CustomField> getSearchInformation() {
        return super.getSearchInformation();
    }

    @Override
    public SearchInputTransformer getSearchInputTransformer() {
        return super.getSearchInputTransformer();
    }

    @Override
    public SearchRenderer getSearchRenderer() {
        return super.getSearchRenderer();
    }

    @Override
    public CustomFieldSearcherClauseHandler getCustomFieldSearcherClauseHandler() {
        return super.getCustomFieldSearcherClauseHandler();
    }

    @Override
    public LuceneFieldSorter getSorter(CustomField customField) {
        return super.getSorter(customField);
    }

    @Override
    public String getSortField(CustomField customField) {
        return super.getSortField(customField);
    }

    @Override
    public SortField.Type getSortFieldType() {
        return super.getSortFieldType();
    }

    @Override
    public void init(CustomFieldSearcherModuleDescriptor customFieldSearcherModuleDescriptor) {
        super.init(customFieldSearcherModuleDescriptor);
    }

    @Override
    public CustomFieldSearcherModuleDescriptor getDescriptor() {
        return super.getDescriptor();
    }
}
search.vm

#disable_html_escaping()
$!{auiparams.put("controlHeaderClass", "aui-field-text")}
#searcherEditHeader (${customField.id} ${customField.name})
<input class="text" id="searcher-$customField.id" name="$customField.id" #if ($configs.styles.style) style="$configs.styles.style"#end type="text" value="$textutils.htmlEncode($!value)" />
#searcherEditFooter (${customField.id} ${customField.descriptionProperty.viewHtml})
$!{auiparams.clear()}

view-seacher.vm

#disable_html_escaping()

#set( $text_invalid_sel = "" )

#if($action.hasAnyErrors())
    #set( $text_invalid_sel = "invalid_sel" )
#end

#searcherHeaderNoField ($customField.id $customField.name $text_invalid_sel)
#if ($value)
    $textutils.htmlEncode($value)
#end
#searcherFooter ($customField)

Hi @Alex5 ,

What is the plugin key in your plugin descriptor? The plugin key should match the package attribute of valid-customfield-type based on the docs. In your snippet, the plugin key should be com.atlassian.jira.plugin.system.customfieldtypes, but if it is not, you might want to try changing the value of package to match your plugin key. The key should also match the key of the custom field you just defined in your descriptor.

If you are trying to use the package and key based on system-customfieldtypes-plugin.xml, I am not sure if that will work in your scenario.

Cheers,
Ian