Skip to content

ElasticSearch Public API

Philo van Kemenade edited this page Apr 4, 2018 · 6 revisions

Web umenia API

SNG is providing public readonly access to the Webumenia ElasticSearch index.

Access

Url is: http://api.webumenia.sk/

You can request the credentials by contacting us at [email protected]

Docs and resources

To learn more about using ElasticSearch you can read the official ES documentation or our presentation.

Schema

The route is forwarded directly to the index /webumenia (no need to specify it).

It's generated by the script SetupElasticsearch.php

It contains two types: items and authorities.

You can see their mapping with curl -XGET -u {username}:{password} 'http://api.webumenia.sk/_mapping?pretty=true'

Available analyzers:

  • ascii_folding
  • autocomplete (being used together with ascii_folding for search suggestions)
  • slovencina apply stopwords + lemmatization + asciifolding
  • slovencina_synonym same as above but adds synonyms

For many properties we use multi_fields.

  • <field> is most usually not_analyzed for exact match or filters & aggregations (query must be exact, e.g. "Štúdia sediaceho muža")
  • <field>.folded use ascii_folding to support search without diacritics (e.g. "studia sediaceho muza")
  • <field>. stemmed use slovencina to support search lemmatization (e.g. "sediaci muz")

Example Queries

Search for public domain artworks:

curl -XGET -u {username}:{password} 'http://api.webumenia.sk/items/_search?q=is_free:1'

or with the query parameters specified as a data object:

curl -XGET -u {username}:{password} http://api.webumenia.sk/items/_search -d '{  "query": {
    "bool": {
      "must":     { "match": { "is_free": true }}
    }
  }
}'
Clone this wiki locally