Display existing fields in Datafari search UI

Let's say we want to display the field last_modified in the search UI of Datafari
The field is already present in the Solr schema so we just need to display it in the UI.

1.Edit the file main.js located in /opt/datafari/tomcat/webapps/Datafari/js/

nano /opt/datafari/tomcat/webapps/Datafari/js/main.js

And change the line :

Manager.store.addByValue("fl", 'title,url,id,extension');

Add the field you want here, so in our example last_modified :

Manager.store.addByValue("fl", 'title,url,id,extension, last_modified');

2. We now have to edit the file  SubClassResultWidget.js : /opt/datafari/tomcat/webapps/Datafari/js/AjaxFranceLabs/widgets/SubClassResultWidget.js

Add the display of your field in the code. For example if you want to add it after the URL of the document : 

And finally your Datafari UI should be like that with the field last_modified at the end of each document :