ESSArch
3.2.1.dev15
  • Introduction
  • Installation
    • Prerequisites
      • Supported OS platforms
      • Database
      • Redis (Minimum version: 5.0)
      • RabbitMQ (Minimum version: 3.8)
      • Elasticsearch (Supported version: 7.*)
    • Automatic installation
    • Docker
      • Dependencies
    • Python
      • Dependencies
      • Install ESSArch
      • Configuring ESSArch
      • Starting the built-in webserver
    • Safety backup procedures
      • Important files to backup
    • Logfiles
      • Events and log information
  • Authentication and authorization
    • Groups
      • Creating groups
      • Adding users to groups
    • Permissions
      • Archival description
        • Agents
        • Structures and nodes
      • Authorization
        • Users
        • Groups
        • Roles
    • Roles
      • Creating roles
      • Assigning roles
  • Configuration
    • Authentication
      • Single Sign-On (SSO)
    • Database
    • Redis
    • RabbitMQ
    • Elasticsearch
    • Paths
      • path_mimetypes_definitionfile
    • Transformers
  • Development Environment
    • Getting the source
    • Setting up virtual Python environments
    • Installing Python dependencies
    • Setting environment variables
    • Configuring services
    • Running migrations
    • Installing initial data
    • Building the frontend
    • Starting the development web server
    • Starting background workers
    • Starting background beat processes
  • Directory Structure
  • External logging and monitoring
    • Using the Elastic Stack
      • Configuration
      • Using Docker
      • Viewing logs in Kibana
  • Format Identifier
    • MIME types
    • Fido
  • Profiles
    • Transformation Profile
      • Specification
    • Validation Profile
      • Specification
      • Built-in validators
        • ChecksumValidator
        • StructureValidator
  • REST API
    • Authentication
      • HTTP Basic Auth
      • Session Authentication
    • Archival description management
      • Agents
      • Agent Type
      • Agent Identifier Type
      • Agent Name Types
      • Agent Note Types
      • Agent Place Type
      • Agent Relation Types
      • Authority Types
      • Deliveries
      • Delivery Types
      • Location
      • Location Level Type
      • Location Function Type
      • Language
      • Metric Type
      • Node Relation Type
      • Node Note Type
      • Node Relation Type
      • Node Identifier Type
      • Node Note Type
      • Structures
      • Structure Units
      • Structure Type
      • Tag
      • Tag Version Type
      • Ref Code
      • Transfers
    • Events
      • Event Types
    • Information Packages
    • Notifications
    • Orders
      • Orders
    • Profiles
      • Profiles
    • Search
      • Retrieve results
      • Filters
      • Combining filters
      • Stored Search
    • Storage
      • Storage Object
      • Storage Medium
      • Storage Methods
      • Storage Method Target Relation
      • Storage Policy
      • Storage Target
    • Submission Agreement
  • User guide
    • Interface
      • List view
      • State view
      • Events view
      • Delete IP
      • User settings
        • Column picker
        • IP view type
        • File browser view type
    • Producer
      • Prepare IP
        • Prepare
        • Profile editor
      • Collect content
        • Upload
      • Create SIP
      • Submit SIP
    • Ingest
      • Reception
        • Receive SIP
      • Approval
        • Preserve
        • Get
        • Get as new generation
    • Access
      • Storage units
        • Get
        • Get as container
        • Get as new generation
      • Dissemination
    • Workspace
    • Archive maintenance
      • Appraisal
        • Create appraisal rule
        • Connect rule to AIP
        • Appraisal job lists
      • Format conversion
        • Create conversion rule
        • Connect rule to AIP
        • Conversion job lists
    • Archival description management
      • Authority records
        • Creating and managing authority records
      • Archival Descriptions
        • Structures
        • Top-level Resources
      • Location Records
        • Creating and managing location records
      • Accession Records
        • Adding new accession records
        • Accession Events
        • Adding transfers
        • Linking resources
      • ESSArch - ICA-Standards
        • ISAAR (CPF)
        • ISAD-G
        • ISDF
    • Storage migration
      • Select storage mediums
      • Select Information packages
      • Storage migration options
      • Preview storage migration
      • Start storage migration
  • XML Generator
    • XML Specification
      • Creating an empty element
    • XML Variables
      • Reserved XML Variables
    • XML Formatters
    • Django Templates
      • Template Tags
ESSArch
  • »
  • REST API »
  • Search
  • Edit on GitHub

Search

  • Retrieve results

  • Filters

  • Combining filters

  • Stored Search

API endpoint to make queries and retrieve results

Retrieve results

GET /api/search

http

GET /api/search/ HTTP/1.1
Host: localhost
Accept: application/json
Authorization: Basic YWRtaW46YWRtaW4=

curl

curl -i -X GET http://localhost/api/search/ -H "Accept: application/json" --user admin:admin

response

HTTP/1.1 200 OK
Content-Type: application/json

{
 "hits": [
     {
         "_index": "component-20191001011857",
         "_type": "doc",
         "_id": "4656f463-6a74-41bd-ad15-5e6500b97571",
         "_score": 0.0,
         "_source": {
             "structure_units": [
                 {
                     "name": "Kommunstyrelsens protokoll med bilagor",
                     "reference_code": "A1",
                     "id": "121",
                     "structure": {
                         "name": "Allmänna Arkivschemat",
                         "id": "102974f1-3d4d-4cfc-9d82-946a9c5521b2",
                         "type": {
                             "name": "förteckningsplan",
                             "id": "2"
                         }
                     }
                 }
             ],
             "name": " En volym med Protokoll",
             "current_version": true,
             "reference_code": "1",
             "archive": {
                 "name": "Kommunstyrelsens arkiv",
                 "reference_code": "12345",
                 "id": "90128ca4-1842-444f-8a27-59391736d6fc"
             },
             "id": "4656f463-6a74-41bd-ad15-5e6500b97571",
             "type": "volym",
             "desc": "",
         }
     },
     {
         "_index": "document-20191001011859",
         "_type": "doc",
         "_id": "746b511c-11a3-49ae-acd3-08180e9fb657",
         "_score": 0.0,
         "_source": {
             "extension": "xsd",
             "filename": "premis.xsd",
             "size": 52845,
             "attachment": {
                 "content_type": "application/xml",
                 "language": "lt",
                 "content_length": 4472
             },
             "ip": "2d9172db-a660-478d-919b-b07228fe5786",
             "name": "premis.xsd",
             "current_version": true,
             "modified": "2019-09-01T02:40:28+02:00",
             "href": "content/2d9172db-a660-478d-919b-b07228fe5786/metadata",
             "type": "document"
         }
     },
     {
         "_index": "document-20191001011859",
         "_type": "doc",
         "_id": "f3b1ed2a-b2b3-44a9-94b1-a71d78609487",
         "_score": 0.0,
         "_source": {
             "extension": "pdf",
             "filename": "filnamn.pdf",
             "size": 3180,
             "attachment": {
                 "content_type": "application/pdf",
                 "language": "lt",
                 "content_length": 386
             },
             "ip": "2d9172db-a660-478d-919b-b07228fe5786",
             "name": "xlink.xsd",
             "current_version": true,
             "modified": "2019-09-01T02:40:28+02:00",
             "href": "content/2d9172db-a660-478d-919b-b07228fe5786/metadata",
             "type": "document"
         }
     }
 ]

Filters

The most commonly used filters used by ESSArch to retrieve objects.

GET /api/search/<uuid>

Retrieves one single indexed object

GET /api/search/indices=<index>,<index>

Retrieves objects from a particular index

GET /api/search/extension=<extension>,<extension>

Retrieves objects filtered by extensions e.g. xml, pdf, docx etc

GET /api/search/type=<type>

Retrieves objects filtered by type e.g. box, document, image, folder etc

GET /api/search/agents=<agent id>,<agent id>

Retrieves results from one or more authority record

GET /api/agents/archives=<archive id>,<archive id>

Retrieves results from one or more top-level resources (Fonds/Archives)

Combining filters

One or more filters can be combined in a query by adding a & between filters.

GET /api/agents/archives=<archive id>&extension=pdf%q=meeting minutes

The above query would retrieve all pdf documents containing the phrase “meeting minutes” from a particular top-level resource (Fond/Archive)

Stored Search

Api endpoint that allows stored searches to be viewed or edited

GET /api/me/searches/

Retrieves the stored searches for the logged in user

http

GET /api/me/searches/ HTTP/1.1
Host: localhost
Accept: application/json
Authorization: Basic YWRtaW46YWRtaW4=

curl

curl -i -X GET http://localhost/api/me/searches/ -H "Accept: application/json" --user admin:admin

response

HTTP/1.1 200 OK
Content-Type: application/json

 [
     {
         "id": 2,
         "name": "My saved search",
         "user": "superuser",
         "query": {
             "q": "protokoll",
             "type": [
                 {
                     "key": "document",
                     "doc_count": 3,
                     "text": "document (3)",
                     "a_attr": {
                         "title": "document"
                     },
                     "state": {
                         "opened": true,
                         "selected": false
                     },
                     "type": "document",
                     "children": []
                 }
             ],
             "page": 1,
             "page_size": 25,
             "extension": {},
             "archives": [
                 {
                     "id": "90128ca4-1842-444f-8a27-59391736d6fc",
                     "elastic_index": "archive",
                     "name": "Kommunstyrelsens arkiv",
                     "type": 1,
                     "create_date": "2019-09-01T02:23:14.832757+02:00",
                     "start_date": "1980-01-01T00:00:00+01:00",
                     "end_date": null
                 }
             ]
         }
     }
 ]
POST /me/searches/

Stores a search for the logged in user

Parameters
  • name – The stored search name

  • query – The query to be stored

Previous Next

© Copyright 2023, ES Solutions.

Built with Sphinx using a theme provided by Read the Docs.