#940: WebSearch: HTTP APIs to query available search fields/indexes, rankings,
etc.
---------------------+-----------------------
Reporter:  jcaffaro  |      Owner:
    Type:  task      |     Status:  new
Priority:  major     |  Component:  WebSearch
 Version:            |   Keywords:  API
---------------------+-----------------------
 Along with the (soon-to-be) added HTTP APIs to retrieve the available
 collections of an Invenio-based repo, we could also add support for
 querying some additional information to launch a query via the search
 APIs. For eg, it should be possible to query about:

  * available fields/indexes (''author'', ''title'', ''language'', etc)
  * available ranking methods (''citation'', ''wrd'', etc.)
  * available output formats (''xm'', ''hb'', ''hx'', etc.)
  * available languages (''en'', ''it'', ''de'', etc.)
  * etc. (?)

 The returned structured (json?) should possibly contain a description for
 each value.

 The above values could also be returned as part of the information sent
 along with the available collection list, as these values might also vary
 based on the collection. Alternatively, we could offer the possibility to
 filter the retrieved values per collection. For eg. the Invenio connector
 (client) could be augmented with the following functions:

 {{{
 def get_fields(c=None, ln=None):
    """
    Returns list of available search index, and their mapping to MARC
 fields:
    {'title': ['titolo', ['245__a', '246__b', '111__a']],
     'abstract': ['riassunto', ['520__%', '590__%']],
     ...
    }
    @param c: list of fields specifically relevant for given collection
    @param ln: language for the description. If not specified, default
 language
               of the repository
    """
    [...]


 def get_ranking_methods(c=None, ln=None):
    """
    Returns list of available ranking methods:
    {'wrd': 'word similarity',
     'citation': ''times cited',
     ...
    }
    @param c: list of rankings specifically relevant for given collection
    @param ln: language for the description. If not specified, default
 language
               of the repository
    """
    [...]

 def get_output_formats(c=None, ln=None):
    """
    Returns list of available output formats:
    {'hb': 'HTML brief',
     'hx': ''BibTeX',
     ...
    }
    @param c: list of output formats specifically relevant for given
 collection
    @param ln: language for the description. If not specified, default
 language
               of the repository
    """
    [...]

 def get_languages():
    """
    Returns list of available output languages
    {'en': 'English',
     'de': 'Deutsch',
     'it': 'Italiano',
     ...
    }
    """
    [...]
 }}}

 In the above examples one could imagine removing the ''ln'' parameter and
 returning all variants in the same call, to minimize number of requests.

 It could also be made mandatory to authenticate to use these API, in order
 to invite developers to use these APIs with care (eg. with client-side
 caching).

-- 
Ticket URL: <http://invenio-software.org/ticket/940>
Invenio <http://invenio-software.org>

Reply via email to