DISHAS API is available at the URL https://dishas.obspm.fr/elastic-query: it offers a fast access to DISHAS's raw data with advanced search functionalities. It relies for now on the elasticsearch query language expressed in a JSON format. Only public data are accessible; draft won't appear in the results.
All main entities of DISHAS database are queryable. They correspond to an elasticsearch index:
Each index is structured according to a particular mapping that defines where each metadata is accessible in the JSON object representing the entity. For more details on how metadata fields are defined for each index, see the "Data structure" section.
The URL of the API admits 6 arguments (optional or mandatory) that define the query that will be sent to the elasticsearch database.
|Mandatory: the index that is going to be queried. It is not now possible to perform cross-index queries.
|The query in itself restricting the number records of the chosen index that will be returned. The query must be formulated in the elasticsearch query language. For examples, see the corresponding section. No query means all records will be returned.
|Defines the fields of metadata that are going to appear in the results. For example, if only identifiers are needed, ["id"] can be provided as source.
|If set to true, the result object will only contain the array of matching records, without the header of every elasticsearch query.
|Maximum number of records contained in the result object (by default, set to 10. Maximal value: 200)
|Defines the offset from the first result you want to fetch (by default, set to0). Useful in case there is more than 200 matching records.
List all records
Endpoint to retrieve a list of all records of a given entity (e.g.: all primary sources)
Show only hits
To retrieve only the results of the query, add &hits=true in the arguments of the URL.
Show only certain fields
To retrieve only certain fields of metadata, add the array of fields you want to appear to the source argument of the URL (e.g. show only the the identifiers of work and the name of their creators).
Find specific resources
To search for specific resources, any elasticsearch query can be passed to the query argument of the URL (e.g. find the work titled "Table of 1322").
To find a resource using its identifier, the id argument of the URL can be use (e.g. find the work that has the id 7).
Note that only one record will be returned, i.e. it won't be contained in an array, even if you don't specify hits=true.
Elasticsearch query language
You can find detailed examples of elasticsearch queries in this wiki.
The location property in an index indicate that it is possible to perform a geo query on this field.
Query on parameter values
The parameter_values property of the parameter_set index is of a special data type, i.e. nested data type. It allows to perform nested queries that execute several filters on the same parameter value.