Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleValid from 4.1

The documentation below is valid from Datafari v4.1 upwards

...

  1. The suggester


    The suggester is used to predict whether the user search term belongs to a category and propose a "special option" in the autocomplete to perform the user search in that specific category.

    Info
    titleIncoming improvement

    If the user selects the option proposed by the suggester, in addition to performing this search in the category, Datafari will soon be able to change the way the results are displayed.


    To configure a suggester for a category you first need to create a new suggest request handler in Solr, based on the desired category field. Then you will need to edit AUTOCOMPLETESUGGESTERS variable in the configuration file DATAFARI_HOME/tomcat/conf/entity-autocomplete.properties :

    Code Block
    AUTOCOMPLETESUGGESTERS=[{"i18nKey":"asAuthor", "serverUrl":"", "servlet":"suggestAuthors", "maxSuggest":1, "categoryKey":"authors", "categoryi18nKey":"authors"}]

    This variable must contain a json array, composed by a list of json objects having the following fields :
    i18nKey - Mandatory : the i18n key to use fort the autocomplete label. The autocomplete label is built like this : [Proposal] [i18n label]. For example, for the author category, an autocomplete proposal could be : Hawkins as author.  The "as author" sentence would be retrieved thanks to the "asAuthor" entry in the i18n files located in DATAFARI_HOME/tomcat/webapp/Datafari/js/AjaxFranceLabs/locale/. Of course you will need to create you desired i18n key and associated label in each language file
    - serverUrl : if the targeted suggest request handler is located and reachable from another server than the Datafari main one, you will need to enter the server address in this variable (like: https://1.2.3.4:8989/External_Sample_Solr_Path)
    - servlet - Mandatory: the servlet name associated to the suggest request handler
    - maxSuggest - Mandatory : maximum number of category suggestions to be displayed within the autocomplete
    - categoryKey - Mandatory : the key name of the category corresponding to the suggester request handler. The key name must match to a field name in the CATEGORIES variable of the DATAFARI_HOME/tomcat/conf/entity-autocomplete.properties file (see below for more info)
    - categoryi18nKey - Mandatory : i18 key name for the category. This is used for the dropdown on the left of the searchfield, that lists the existing categories. This field must have a matching entry in the language files located in DATAFARI_HOME/tomcat/webapp/Datafari/js/AjaxFranceLabs/locale/


  2. The category


    Like described above, each suggester must be associated to a category. The categories are defined in the CATEGORIES variable of the DATAFARi_HOME/tomcat/conf/entity-autocomplete.properties file :

    Code Block
    CATEGORIES={"authors":{"queryPrefix":"author_search:(", "querySuffix":")", "solrCore":"", "requestHandler":""}}

    This variable must contain a json object composed of categories keyname as fields and json objects as values representing the categories specific options :
    queryPrefix : a query prefix to add to each search for this category
    - querySuffix : a query suffix to add to each search for this category
    - solrCore : the Solr Core to request if it differs from the default one "FileShare". This Solr Core must be local to your Datafari install.
    - requestHandler : the request handler that executes the query if it differs from the default one "/select". This request handler must be local to your Datafari install.

    These are the pre-configured options of the beta version of the categories features. You can add more options like filter queries, field list etc. but you will need to write some code to handle them in the SearchProxy servlet of Datafari

...

To enable or disable the categories feature you will need to change the value of the ACTIVATED variable of the DATAFARi_HOME/tomcat/conf/entity-autocomplete.properties file to true or false. By default, it is set to false.