Skip to content

Universal Search API Specification

Pascal Dihé edited this page Jan 19, 2015 · 8 revisions

Universal Search API Specification

client-side: Universal Search Box

The Universal Search Box allows to specifically search for resources by defining different pre-search filters (keywords, spatial coverage, temporal coverage, ...) of resources. Depending on the types of pre-search filters specified, a specific input format of the filter expressions entered is expected.

The general format for such a filter expression is: $filter : "$parameter", whereby $filter is an arbitrary filter keyword and $parameter is an arbitrary value in double quotes. A simple RegEx for validating filter expressions is /^(\w+:".+"\s?)+$/

universal-search-box

The filter-specific formats of the filter parameters may differ from filter to filter. See below for a list of predefined filters.

For the user, there are two possibilities for specifying pre-search filters that are applied when performing a search for resources with help of the Universal Search Box:

    1. The user can directly input appropriate filter expressions in the Universal Search Box (1), e.g. keyword:"water quality”, or
    1. the user can use various UI Widgets, for example the Search Filter Ribbon, that are provided for different type of search filters (spatial, temporal, keywords, ...).

Some filters, like keywords, can occur multiple times. If not specified otherwise in the of the respective filter description, for each filter a separate filter expression is added to the Universal Search String. Thus, the preferred syntax for such filters is for example not keywords:"water quality, catchments" but keyword:"water quality keyword:"catchments"

server-side: Universal Search API

The Universal Search API is simple API for server searches that (currently!) accepts a single get parameter (query) that expects a complete Universal Search String and returns a collection of resources (cids JSON objects).

Example: ?query=fromdate:%222014-12-31%22+todate:%222015-01-15%22+keyword:%22water+quality%22

Predefined Filters

This is a non exhaustive list of predefined filters. Both the Universal Search Box and the Universal Search API must accept any filter expression that conforms to the general format for filter expressions.

Clone this wiki locally