foliolib.folio.api.search.SearchAdmin
- class foliolib.folio.api.search.SearchAdmin
Bases:
foliolib.folio.FolioAdminApiSearch API Administration
Search API
Base class of not tenant related Folio API.
Methods
createlanguageconfig(languageConfig)Save languages that will be used for analyzers
deletefeatureconfigurationbyid(featureId)Delete feature configuration by id
deletelanguageconfig(code)Delete all supported languages
Get all feature configurations per tenant
Get all supported languages
getbrowseconfigs(browseType)Get all configurations for browse type
indexrecords(indexRecordRequest)Indexes the records into elasticsearch.
putbrowseconfig(browseType, browseOptionId, ...)Update configuration for browse type
savefeatureconfiguration(featureConfig)Save feature configuration (enables or disables pre-defined optional search options)
updatefeatureconfiguration(featureId, ...)Update feature configuration settings
updatelanguageconfig(code, languageConfig)Update language config settings
- createlanguageconfig(languageConfig)
Save languages that will be used for analyzers
POST /search/config/languages- Parameters
languageConfig (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestUnprocessableEntity – Validation error for the request.
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Language config", "properties": { "code": { "type": "string", "description": "An ISO-639-2/B compatible language code.", "pattern": "[a-zA-Z]{3}" }, "languageAnalyzer": { "type": "string", "description": "Custom elasticsearch analyzer for language." } }, "additionalProperties": false, "required": [ "code" ] }
- deletefeatureconfigurationbyid(featureId)
Delete feature configuration by id
DELETE /search/config/features/{featureId}- Parameters
featureId (str) – Feature id (name) (enum: [‘search.all.fields’, ‘browse.cn.intermediate.values’, ‘browse.cn.intermediate.remove.duplicates’, ‘browse.classifications’])
- Raises
OkapiRequestNotFound – No feature configuration is found by id
- deletelanguageconfig(code)
Delete all supported languages
DELETE /search/config/languages/{code}- Parameters
code (str) – Language code (pattern: [a-zA-Z]{3})
- Raises
OkapiRequestNotFound – No language support is found
- getallfeatures()
Get all feature configurations per tenant
GET /search/config/features- Returns
See Schema below.
- Return type
dict
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Feature configs response per tenant", "properties": { "features": { "type": "array", "description": "Configured features per tenant", "items": { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Feature config request value", "properties": { "feature": { "$schema": "http://json-schema.org/draft-04/schema#", "type": "string", "description": "The feature name.", "enum": [ "search.all.fields", "browse.cn.intermediate.values", "browse.cn.intermediate.remove.duplicates", "browse.classifications" ] }, "enabled": { "type": "boolean", "description": "Action - enable or disable option" } }, "additionalProperties": false, "required": [ "feature", "enabled" ] } }, "totalRecords": { "type": "integer", "description": "Total records that matches the query.", "minimum": 0 } } }
- getalllanguageconfigs()
Get all supported languages
GET /search/config/languages- Returns
See Schema below.
- Return type
dict
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Language config", "properties": { "languageConfigs": { "type": "array", "description": "Configured languages for a tenant", "items": { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Language config", "properties": { "code": { "type": "string", "description": "An ISO-639-2/B compatible language code.", "pattern": "[a-zA-Z]{3}" }, "languageAnalyzer": { "type": "string", "description": "Custom elasticsearch analyzer for language." } }, "additionalProperties": false, "required": [ "code" ] } }, "totalRecords": { "type": "integer", "description": "Total records that matches the query.", "minimum": 0 } }, "additionalProperties": false, "required": [ "languageConfigs", "totalRecords" ] }
- getbrowseconfigs(browseType)
Get all configurations for browse type
GET /browse/config/{browseType}- Parameters
browseType (str) – Browse feature type (enum: [‘instance-classification’])
- Returns
See Schema below.
- Return type
dict
Schema
{ "type": "object", "properties": { "configs": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "enum": [ "all", "lc", "dewey" ] }, "shelvingAlgorithm": { "type": "string", "enum": [ "lc", "dewey", "default" ] }, "typeIds": { "description": "Type IDs that should be used by the option", "type": "array", "items": { "description": "Type ID", "type": "string", "format": "uuid" } } }, "required": [ "id", "shelvingAlgorithm" ] } }, "totalRecords": { "type": "integer" } } }
- indexrecords(indexRecordRequest)
Indexes the records into elasticsearch.
POST /search/index/records- Parameters
indexRecordRequest (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestFatalError – When unhandled exception occurred during code execution, e.g. NullPointerException
Schema
{ "type": "array", "items": { "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "description": "Resource event body", "properties": { "id": { "description": "Resource id", "type": "string" }, "type": { "type": "string", "$schema": "http://json-schema.org/draft-04/schema#", "description": "Resource event operation type - one of [update, create, delete, delete_all, reindex]", "enum": [ "UPDATE", "CREATE", "DELETE", "REINDEX", "DELETE_ALL" ] }, "deleteEventSubType": { "type": "string", "$schema": "http://json-schema.org/draft-04/schema#", "description": "Resource event delete operation type - one of [soft-delete, hard-delete]", "enum": [ "SOFT_DELETE", "HARD_DELETE" ] }, "tenant": { "description": "Tenant id", "type": "string" }, "resourceName": { "description": "Name of resource", "type": "string" }, "new": { "description": "Instance record new fields", "type": "object" }, "old": { "description": "Instance record old fields", "type": "object" } } } }
{ "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 }
- putbrowseconfig(browseType, browseOptionId, browseConfig)
Update configuration for browse type
PUT /browse/config/{browseType}/{browseOptionId}- Parameters
browseType (str) – Browse feature type (enum: [‘instance-classification’])
browseOptionId (str) – Browse option type (enum: [‘all’, ‘lc’, ‘dewey’])
browseConfig (dict) – See Schema below.
- Raises
OkapiRequestError – Validation errors
OkapiRequestUnprocessableEntity – Validation error for the request.
Schema
{ "type": "object", "properties": { "id": { "type": "string", "enum": [ "all", "lc", "dewey" ] }, "shelvingAlgorithm": { "type": "string", "enum": [ "lc", "dewey", "default" ] }, "typeIds": { "description": "Type IDs that should be used by the option", "type": "array", "items": { "description": "Type ID", "type": "string", "format": "uuid" } } }, "required": [ "id", "shelvingAlgorithm" ] }
- savefeatureconfiguration(featureConfig)
Save feature configuration (enables or disables pre-defined optional search options)
POST /search/config/features- Parameters
featureConfig (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Validation errors
OkapiRequestUnprocessableEntity – Validation error for the request.
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Feature config request value", "properties": { "feature": { "$schema": "http://json-schema.org/draft-04/schema#", "type": "string", "description": "The feature name.", "enum": [ "search.all.fields", "browse.cn.intermediate.values", "browse.cn.intermediate.remove.duplicates", "browse.classifications" ] }, "enabled": { "type": "boolean", "description": "Action - enable or disable option" } }, "additionalProperties": false, "required": [ "feature", "enabled" ] }
- updatefeatureconfiguration(featureId, featureConfig)
Update feature configuration settings
PUT /search/config/features/{featureId}- Parameters
featureId (str) – Feature id (name) (enum: [‘search.all.fields’, ‘browse.cn.intermediate.values’, ‘browse.cn.intermediate.remove.duplicates’, ‘browse.classifications’])
featureConfig (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Validation errors
OkapiRequestUnprocessableEntity – Validation error for the request.
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Feature config request value", "properties": { "feature": { "$schema": "http://json-schema.org/draft-04/schema#", "type": "string", "description": "The feature name.", "enum": [ "search.all.fields", "browse.cn.intermediate.values", "browse.cn.intermediate.remove.duplicates", "browse.classifications" ] }, "enabled": { "type": "boolean", "description": "Action - enable or disable option" } }, "additionalProperties": false, "required": [ "feature", "enabled" ] }
- updatelanguageconfig(code, languageConfig)
Update language config settings
PUT /search/config/languages/{code}- Parameters
code (str) – Language code (pattern: [a-zA-Z]{3})
languageConfig (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestUnprocessableEntity – Validation error for the request.
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Language config", "properties": { "code": { "type": "string", "description": "An ISO-639-2/B compatible language code.", "pattern": "[a-zA-Z]{3}" }, "languageAnalyzer": { "type": "string", "description": "Custom elasticsearch analyzer for language." } }, "additionalProperties": false, "required": [ "code" ] }