Skip to content

ElasticSearch Public API

Igor Rjabinin edited this page Jun 11, 2020 · 6 revisions

Web umenia API

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

Access

URL is: https://www.webumenia.sk/api/

You can request the credentials by contacting us at lab@sng.sk

Docs and resources

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

Schema

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

It's generated by the script SetupElasticsearch.php

It contains index types: items and authorities, with their respective en, sk, and cz translations, i.e. items_en, items_sk, authorities_cs etc.

You can list all indices with their mapping with curl -XGET -u {username}:{password} 'https://www.webumenia.sk/api/*/_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} 'https://www.webumenia.sk/api/items_sk/_search?q=is_free:true'

search across all translations:

curl -XGET -u {username}:{password} 'https://www.webumenia.sk/api/items_*/_search?q=is_free:true'

or with the query parameters specified as a data object:

curl -XGET -u {username}:{password} https://www.webumenia.sk/api/items_sk/_search -d '{
  "query": {
    "bool": {
      "must": [
        { "term": { "is_free": true } }
      ]
    }
  }
}'
Clone this wiki locally