I am following this tutorial concerning adding custom dataset/resource fields for CKAN: http://docs.ckan.org/en/latest/extensions/adding-custom-fields.html
I have successfully added custom fields for both datasets and resources. However, I have two questions.
1.) Resource metadata fields do not currently appear to be indexed. How do I enable Solr indexing of the custom metadata fields for resources?
2.) How can I re-arrange the order of the metadata fields on the UI?
To answer your questions in order:
/templates/package/search.html
in your extension This allows SOLR to use your fields to order the SOLR search results. You may need to reload your development server for the changes to take effect. You can follow a guide here: http://docs.ckan.org/en/latest/extensions/adding-custom-fields.html#sorting-by-custom-fields-on-the-dataset-search-page
Also, you could implement this function in your plugin.py `
def before_index(self, index_dict):
#Implement some package level stuff here and put the value in the index_dict
index_dict['your_choice_index_name'] = 'your proposed value'
return index_dict
templates/package
. If that's what you refer to by meta-data fields on the UI.I hope this helps.