[DEPRECATED] Ajaxfrancelabs Displaying thumbnails for autocomplete and results list

Ajaxfrancelabs is deprecated as of Datafari v6.0 aside from specific admin and search expert functionalities. Please refer to https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/1517813761 for any search UI related task.

This documentation explains how to enable the « pictures » mode for the results display, for instance if you are indexing videos or pictures.

Note that this functionality is not complete yet, as of Datafari 2.0. For now the pointer to the image used is hardcoded. We still need to create a dedicated field in Solr that will hold the urls to the image, and to modify the widget so that it uses this field.

  1. In searchView.jsp, you need to include « results-illustrate.css » which is in the css folder of datafari. Note that the css is already present, you just need to uncomment it.

  2. In search.js, you need to replace resultWidget by with ResultIllustratedWidget, using the same attributes that resultWidget had.

This will make space for the image and show it at the left of the results in desktop mode and at the right of the results in the mobile mode. You can see below how it will appear :

Now to have the pictures in the autocomplete functionnality, do the following :

  1. In search.js, replace « AjaxFranceLabs.SearchBarWidget » with « AjaxFranceLabs.SearchBarIllustratedWidget », using the same parameters. And then you have it !

Note that this functionnality uses the following two javascripts, which are included by default « js/AjaxFranceLabs/widgets/SearchBarIllustrated.widget.js » and « js/AjaxFranceLabs/modules/AutocompleteIllustrated.module.js » .

Note also that this functionality is a better fit for suggestions rather than for search autocomplete. For instance, in a digital asset management scenario, the autocomplete with the image would propose me when clicking on it directly the image rather than triggering a search on the solr. For now, we have not coded such a suggestion widget.

This widget is currently visually optimised for a fixed image size. If the source images do not have this size, we do a basic resize operation, which may lead to not-so-good-looking displays of the thumbnails.