foliolib
0.3.8a1

Contents:

  • Documentation
  • Singleserver installation
  • Kubernetes installation
  • Configuration Reference
  • CLI Reference
  • API Reference
    • foliolib.config
    • foliolib.okapi package
    • foliolib.helper package
    • foliolib.folio package
    • foliolib.folio.api package
      • Modules
        • foliolib.folio.api.audit
        • foliolib.folio.api.authtoken
        • foliolib.folio.api.bulkOperations
        • foliolib.folio.api.calendar
        • foliolib.folio.api.circulation
        • foliolib.folio.api.circulationStorage
        • foliolib.folio.api.configuration
        • foliolib.folio.api.consortia
        • foliolib.folio.api.copycat
        • foliolib.folio.api.courses
        • foliolib.folio.api.dataExport
        • foliolib.folio.api.dataExportSpring
        • foliolib.folio.api.dataExportWorker
        • foliolib.folio.api.dataImport
        • foliolib.folio.api.dataImportConverterStorage
        • foliolib.folio.api.diConverterStorage
        • foliolib.folio.api.ebsconet
        • foliolib.folio.api.email
        • foliolib.folio.api.entitiesLinks
        • foliolib.folio.api.ermUsage
        • foliolib.folio.api.ermUsageHarvester
        • foliolib.folio.api.eusageReports
        • foliolib.folio.api.eventConfig
        • foliolib.folio.api.feesfines
        • foliolib.folio.api.finance
        • foliolib.folio.api.financeStorage
        • foliolib.folio.api.fincConfig
        • foliolib.folio.api.folioCustomFields
        • foliolib.folio.api.folioSpringBase
        • foliolib.folio.api.folioVertxLib
        • foliolib.folio.api.gobi
        • foliolib.folio.api.idmConnect
        • foliolib.folio.api.innReach
        • foliolib.folio.api.inventory
        • foliolib.folio.api.inventoryStorage
        • foliolib.folio.api.inventoryUpdate
        • foliolib.folio.api.invoice
        • foliolib.folio.api.invoiceStorage
        • foliolib.folio.api.kbEbscoJava
        • foliolib.folio.api.ldp
        • foliolib.folio.api.licenses
        • foliolib.folio.api.login
        • foliolib.folio.api.loginSaml
        • foliolib.folio.api.marccat
        • foliolib.folio.api.metaStorage
        • foliolib.folio.api.notes
        • foliolib.folio.api.notify
        • foliolib.folio.api.oaiPmh
        • foliolib.folio.api.orders
        • foliolib.folio.api.ordersStorage
        • foliolib.folio.api.organizations
        • foliolib.folio.api.organizationsStorage
        • foliolib.folio.api.passwordValidator
        • foliolib.folio.api.patron
        • foliolib.folio.api.patronBlocks
        • foliolib.folio.api.permissions
        • foliolib.folio.api.pubsub
        • foliolib.folio.api.quickMarc
        • foliolib.folio.api.remoteStorage
        • foliolib.folio.api.reservoir
        • foliolib.folio.api.rtac
        • foliolib.folio.api.search
        • foliolib.folio.api.sender
        • foliolib.folio.api.settings
        • foliolib.folio.api.sharedIndex
        • foliolib.folio.api.sourceRecordManager
        • foliolib.folio.api.sourceRecordStorage
        • foliolib.folio.api.tags
        • foliolib.folio.api.templateEngine
        • foliolib.folio.api.userImport
        • foliolib.folio.api.users
        • foliolib.folio.api.usersBl
foliolib
  • API Reference
  • foliolib.folio.api package
  • foliolib.folio.api.search
  • foliolib.folio.api.search.Search
  • Edit on GitHub

foliolib.folio.api.search.Search

class foliolib.folio.api.search.Search(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Search API

Search API

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

browseauthorities(**kwargs)

Provides list of authorities by headingRef

browseinstancesbycallnumber(**kwargs)

Provides list of instances for browsing by call number

browseinstancesbycontributor(**kwargs)

Provides list of instances for browsing by contributor

browseinstancesbysubject(**kwargs)

Provides list of instances for browsing by subject

createindices(createIndexRequest)

Creates indices for passed resource name and tenant id in request header.

getfacets(recordType, **kwargs)

Provides list of facets for the record type

getholdingids(**kwargs)

Get a list of holding ids linked to instances found by the CQL query

getidsjob(jobId)

Get a job for the stream of resource ids.

getinstanceids(**kwargs)

Get a list of instance ids for CQL query

getresourceids(jobId)

Get a list of resource ids by job id

reindexinventoryrecords(reindexRequest)

Initiates reindex for the inventory records

searchauthorities(**kwargs)

Get a list of authorities for CQL query

searchinstances(**kwargs)

Get a list of instances for CQL query

submitidsjob(resourceIdsJob)

Creates a job for the stream of resource ids.

updateindexdynamicsettings(...)

Update Index Dynamic Settings data.

updatemappings(updateMappingsRequest)

Creates mappings for passed resource name and tenant id in request header.

browseauthorities(**kwargs)

Provides list of authorities by headingRef

GET /browse/authorities

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 100)

  • expandAll (bool) – Whether to return only basic properties or entire instance. (default: False)

  • highlightMatch (bool) – Whether to highlight matched resource by query input or not. (default: True)

  • precedingRecordsCount (int) – Number of preceding records for browsing around and around-including options (minimum: 1, maximum: 100)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Authority browse search response",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "Amount of items to display"
        },
        "prev": {
            "type": "string",
            "description": "Previous value for browsing backward"
        },
        "next": {
            "type": "string",
            "description": "Next value for browsing forward"
        },
        "items": {
            "type": "array",
            "description": "List of authority browse items",
            "items": {
                "$ref": "authorityBrowseItem.json"
            }
        }
    }
}
browseinstancesbycallnumber(**kwargs)

Provides list of instances for browsing by call number

GET /browse/call-numbers/instances

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • limit (int) – Limit the number of elements returned in the browse response. (minimum: 0, maximum: 100, default: 100)

  • expandAll (bool) – Whether to return only basic properties or entire instance. (default: False)

  • highlightMatch (bool) – Whether to highlight matched resource by query input or not. (default: True)

  • precedingRecordsCount (int) – Number of preceding records for browsing around and around-including options (minimum: 1, maximum: 100)

  • callNumberType (str) – Type of call number (enum: [‘lc’, ‘dewey’, ‘nlm’, ‘sudoc’, ‘other’, ‘local’])

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Call number browse search response",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "Amount of items to display"
        },
        "prev": {
            "type": "string",
            "description": "Previous value for browsing backward"
        },
        "next": {
            "type": "string",
            "description": "Next value for browsing forward"
        },
        "items": {
            "type": "array",
            "description": "List of call number browse items",
            "items": {
                "$ref": "callNumberBrowseItem.json"
            }
        }
    }
}
browseinstancesbycontributor(**kwargs)

Provides list of instances for browsing by contributor

GET /browse/contributors/instances

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 100)

  • highlightMatch (bool) – Whether to highlight matched resource by query input or not. (default: True)

  • precedingRecordsCount (int) – Number of preceding records for browsing around and around-including options (minimum: 1, maximum: 100)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Instance contributor browse search response",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "Amount of items to display"
        },
        "prev": {
            "type": "string",
            "description": "Previous value for browsing backward"
        },
        "next": {
            "type": "string",
            "description": "Next value for browsing forward"
        },
        "items": {
            "type": "array",
            "description": "List of instance contributor browse items",
            "items": {
                "$ref": "instanceContributorBrowseItem.json"
            }
        }
    }
}
browseinstancesbysubject(**kwargs)

Provides list of instances for browsing by subject

GET /browse/subjects/instances

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 100)

  • highlightMatch (bool) – Whether to highlight matched resource by query input or not. (default: True)

  • precedingRecordsCount (int) – Number of preceding records for browsing around and around-including options (minimum: 1, maximum: 100)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Subject browse search response",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "Amount of items to display"
        },
        "prev": {
            "type": "string",
            "description": "Previous value for browsing backward"
        },
        "next": {
            "type": "string",
            "description": "Next value for browsing forward"
        },
        "items": {
            "type": "array",
            "description": "List of subject browse items",
            "items": {
                "$ref": "subjectBrowseItem.json"
            }
        }
    }
}
createindices(createIndexRequest)

Creates indices for passed resource name and tenant id in request header.

POST /search/index/indices

Parameters

createIndexRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Request body to create Elasticsearch index",
    "properties": {
        "resourceName": {
            "type": "string",
            "description": "Name of resource"
        }
    },
    "additionalProperties": false,
    "required": [
        "resourceName"
    ]
}
{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Folio search create index response",
    "properties": {
        "errorMessage": {
            "type": "string",
            "description": "Error message with the reason why index was failed to create."
        },
        "indices": {
            "type": "array",
            "description": "List of created elasticsearch indices.",
            "minItems": 0,
            "items": {
                "description": "Create index name",
                "type": "string"
            }
        },
        "status": {
            "type": "string",
            "description": "Index creation status - success or error.",
            "enum": [
                "success",
                "error"
            ]
        }
    },
    "additionalProperties": false
}
getfacets(recordType, **kwargs)

Provides list of facets for the record type

GET /search/{recordType}/facets

Parameters

recordType (str) – (enum: [‘instances’, ‘authorities’, ‘contributors’])

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • facet (list) – List of facet names. (items: (type: string))

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Facet result response",
    "type": "object",
    "properties": {
        "facets": {
            "description": "Map with found facet items, key is the facet name, value - facet object with found values",
            "type": "object",
            "additionalProperties": {
                "$ref": "facet.json"
            }
        },
        "totalRecords": {
            "type": "integer",
            "description": "Amount of facets found"
        }
    }
}
getholdingids(**kwargs)

Get a list of holding ids linked to instances found by the CQL query

GET /search/holdings/ids

Keyword Arguments

query (str) – A CQL query string with search conditions.

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

getidsjob(jobId)

Get a job for the stream of resource ids.

GET /search/resources/jobs/{jobId}

Parameters

jobId (str) – UUID of the job to get

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Job for the stream of entity ids.",
    "properties": {
        "id": {
            "type": "string",
            "description": "Unique ID for the job record."
        },
        "query": {
            "type": "string",
            "description": "CQL query for getting ids."
        },
        "status": {
            "type": "string",
            "description": "Ids streaming status.",
            "enum": [
                "IN_PROGRESS",
                "ERROR",
                "COMPLETED",
                "DEPRECATED"
            ]
        },
        "entityType": {
            "type": "string",
            "description": "Type of entity for streaming ids.",
            "enum": [
                "INSTANCE",
                "AUTHORITY",
                "HOLDINGS"
            ]
        },
        "createdDate": {
            "description": "Date and time when the record was created.",
            "type": "string"
        }
    },
    "additionalProperties": false,
    "required": [
        "query",
        "entityType"
    ]
}
getinstanceids(**kwargs)

Get a list of instance ids for CQL query

GET /search/instances/ids

Keyword Arguments

query (str) – A CQL query string with search conditions.

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

getresourceids(jobId)

Get a list of resource ids by job id

GET /search/resources/jobs/{jobId}/ids

Parameters

jobId (str) – UUID of the job to get

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

reindexinventoryrecords(reindexRequest)

Initiates reindex for the inventory records

POST /search/index/inventory/reindex

Parameters

reindexRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises

OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Reindex Request body",
    "type": "object",
    "properties": {
        "recreateIndex": {
            "type": "boolean",
            "default": false,
            "description": "Boolean parameter, if set to true - tenant index must be recreated before reindex operation"
        },
        "resourceName": {
            "type": "string",
            "description": "Resource name to run reindex for",
            "default": "instance"
        },
        "indexSettings": {
            "description": "Index settings to apply for index",
            "$ref": "../indexSettings.json"
        }
    }
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Get job by id response",
    "type": "object",
    "properties": {
        "id": {
            "description": "Job id",
            "type": "string"
        },
        "jobStatus": {
            "description": "Overall job status",
            "type": "string"
        },
        "submittedDate": {
            "description": "Timestamp when the job has been submitted",
            "type": "string"
        }
    }
}
searchauthorities(**kwargs)

Get a list of authorities for CQL query

GET /search/authorities

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 100)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (minimum: 0, maximum: 9999, default: 0)

  • expandAll (bool) – Whether to return only basic properties or entire instance. (default: False)

  • includeNumberOfTitles (bool) – Whether to perform a search for a number of linked instances. (default: True)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Authority search result response",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "Amount of authorities found"
        },
        "authorities": {
            "type": "array",
            "description": "List of authorities found",
            "items": {
                "$ref": "../authority.json"
            }
        }
    }
}
searchinstances(**kwargs)

Get a list of instances for CQL query

GET /search/instances

Keyword Arguments
  • query (str) – A CQL query string with search conditions.

  • limit (int) – Limit the number of elements returned in the response. (minimum: 0, maximum: 500, default: 100)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (minimum: 0, maximum: 9999, default: 0)

  • expandAll (bool) – Whether to return only basic properties or entire instance. (default: False)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Instance search result response",
    "type": "object",
    "properties": {
        "totalRecords": {
            "type": "integer",
            "description": "Amount of instances found"
        },
        "instances": {
            "type": "array",
            "description": "List of instances found",
            "items": {
                "$ref": "../instance.json"
            }
        }
    }
}
submitidsjob(resourceIdsJob)

Creates a job for the stream of resource ids.

POST /search/resources/jobs

Parameters

resourceIdsJob (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Validation errors

  • OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Job for the stream of entity ids.",
    "properties": {
        "id": {
            "type": "string",
            "description": "Unique ID for the job record."
        },
        "query": {
            "type": "string",
            "description": "CQL query for getting ids."
        },
        "status": {
            "type": "string",
            "description": "Ids streaming status.",
            "enum": [
                "IN_PROGRESS",
                "ERROR",
                "COMPLETED",
                "DEPRECATED"
            ]
        },
        "entityType": {
            "type": "string",
            "description": "Type of entity for streaming ids.",
            "enum": [
                "INSTANCE",
                "AUTHORITY",
                "HOLDINGS"
            ]
        },
        "createdDate": {
            "description": "Date and time when the record was created.",
            "type": "string"
        }
    },
    "additionalProperties": false,
    "required": [
        "query",
        "entityType"
    ]
}
updateindexdynamicsettings(updateIndexDynamicSettingsRequest)

Update Index Dynamic Settings data.

PUT /search/index/settings

Parameters

updateIndexDynamicSettingsRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises

OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Update Index Settings request body",
    "type": "object",
    "properties": {
        "resourceName": {
            "type": "string",
            "description": "Resource name to set index Settings"
        },
        "indexSettings": {
            "description": "Index settings to apply for index",
            "$ref": "../indexDynamicSettings.json"
        }
    },
    "required": [
        "resourceName"
    ]
}
{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Folio search create index response",
    "properties": {
        "errorMessage": {
            "type": "string",
            "description": "Error message with the reason why index was failed to create."
        },
        "status": {
            "type": "string",
            "description": "Index creation status - success or error.",
            "enum": [
                "success",
                "error"
            ]
        }
    },
    "additionalProperties": false
}
updatemappings(updateMappingsRequest)

Creates mappings for passed resource name and tenant id in request header.

POST /search/index/mappings

Parameters

updateMappingsRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises

OkapiFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException

Schema

{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Request to create resource mappings in Elasticsearch",
    "properties": {
        "resourceName": {
            "type": "string",
            "description": "Name of resource"
        }
    },
    "additionalProperties": false,
    "required": [
        "resourceName"
    ]
}
{
    "type": "object",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Folio search create index response",
    "properties": {
        "errorMessage": {
            "type": "string",
            "description": "Error message with the reason why index was failed to create."
        },
        "status": {
            "type": "string",
            "description": "Index creation status - success or error.",
            "enum": [
                "success",
                "error"
            ]
        }
    },
    "additionalProperties": false
}
Previous Next

© Copyright 2023, Tobias Weber. Revision 56ea99b0.

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