The search API uses a query parser to translate the URL parameters to the search engine (currently ElasticSearch) used by ORTOLANG. Using a query allows users to filter a list of elements. Each element is a JSON document indexed by the search engine.
A field matches a specific attribute in the JSON document (https://en.wikipedia.org/wiki/JSON). In order to query a document, a field can be filtered using the dot notation like a.b.c where a, b and c are attributes. For example, the attribute format of a oai_dc JSON document can be reached with the following field streamContent.format.value.
A field can be followed by a marker:
- : allows to query an array (https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-nested-query.html)
- *: allows to match phrase prefix query (https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-match-query-phrase-prefix.html).
If no marker is following the field, it matches a term (https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-term-query.html).
Every field must exist in the matching documents.
Some terms are interpreted by the query parser.
- size: allows to limit the number of documents returned
- includes: an array specifying the fields returned for each document
- excludes: an array specifying the fields excluded
- orderProp: sets the field used for sorting
- orderDir: sets the direction of the sort
- aggregation: specify the fields returned in the aggregations section (see https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-aggregations.html).
The others terms are used for filtering and need to match a field in the document.
The search API allows to filter a list of metadata object by sending an HTTP GET request.
Resource URL: https://repository.ortolang.fr/api/search/metadata
Postman collection: Search.postman_collection.json