Skip to content

Latest commit

 

History

History
44 lines (38 loc) · 1.19 KB

README-database-api.md

File metadata and controls

44 lines (38 loc) · 1.19 KB

Database API

The Protokollen site uses an API to query the Elasticsearch database. This is endpoint is open to GET and POST requests.

You can pass JSON objects to the endpoint to make Elasticsearch queries. This query

Request URI: https://protokollen.herokuapp.com/api/documents/_search?size=10&from=0&fields=origin,meeting_date,document_type,text_file,file,text,last_updated,source

Content-Type: application/json

Request payload:

{
    "filter": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "document_type": [
                            "kommunstyrelseprotokoll"
                        ]
                    }
                },
                {
                    "terms": {
                        "origin": [
                            "Arvidsjaurs kommun"
                        ]
                    }
                }
            ]
        }
    },
    "sort": [
        {
            "meeting_date": {
                "order": "desc"
            }
        }
    ]
}