[DEPRECATED] Add custom fields in Datafari and display them

Let's say we want to add a new metadata field in Solr named meta:author in the source and named authorname in Datafari. 
Let's see each step to display the field into the Datafari UI and permit to search into the field with Solr. 

1) Edit solrconfig.xml 

We want to map the original metadata of the source file : meta:author to a new Solr field named authorname. So we have to edit the Solr cell request handler :

<requestHandler name="/update/extract" startup="lazy" class="solr.extraction.ExtractingRequestHandler" > <lst name="defaults"> <str name="scan">false</str> <str name="captureAttr">true</str> <str name="lowernames">true</str> <str name="fmap.language">ignored_</str> <str name="fmap.meta_author">authorname</str> <str name="fmap.source">ignored_</str> <str name="uprefix">ignored_</str> <str name="update.chain">datafari</str> <bool name="ignoreTikaException">true</bool>

The correct syntax is meta_author (and not meta:author) because of the line 
<str name="lowernames">true</str> 
The documentation says : "lowernames=true|false - Map all field names to lowercase with underscores"

You can also see in the configuration that we store all the ignored metadata in the dynamic field ignored. I invite you to change the configuration of the field in the schema.xml and to change stored=false to store=true to see all the metadata found by Tika (and to see the correct syntax to map the fields into Solr) For example : 

2) Edit schema.xml 

We want now to add the new field into the Solr schema. So add the following line :

<field name="authorname" type="text_en" indexed="true" stored="true" multiValued="true"/>

Ok so far we can launch the indexation with ManifoldCF and the new field is well present in Solr.

3) Add the new field to the search: Edit solrconfig.xml, in the select request handler add the field :

<str name="qf">author title_en^50 title_fr^50 content_fr^10 content_en^10 source^20 extension^20</str>

After the core reloads, we can now search and find the data of the new field.

4) Configure the Datafari UI into datafari/tomcat/webapps/Datafari/js/main.js (source code) or Datafari/tomcat/webapps/Datafari/js/main.js (installed version) Change the line :

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

And add the field you want to add, here autorname

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

The last step is to change the Javascript file search.js : datafari/WebContent/js/search.js (source code) or Datafari/tomcat/webapps/Datafari\js/search.js (installed version) Add the display of your field adding the code : doc.subject where you want to add it. For example if you want to add it after the URL of the document : (I made a mistake in my previous answer, it is correct now)

elm.find('.doc:last .address').append('<span>' + AjaxFranceLabs.tinyUrl(decodeURIComponent(url)) + '</span>') elm.find('.doc:last .address').append('<div id="author">' + doc.author );

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