Search/Facet
Search/Facet is a service within DiscoverItem that is used to retrieve facets for an active search.
HTTP Method: GET
HTTP Method: POST
HTTP Header Content-Type: "application/json"
HTTP Header User-Agent: ${user-agent}
Standard HTTP clients (browser, HTTP client libraries, etc.) will automatically include its User-Agent value.
Search URL:
https://HOSTNAME/di/search/facet
Search/Facet parameters
Parameter Name | Definición | Required/Optional/etc. | Notes |
---|---|---|---|
aid | A valid authorization ID | Requerido | Refer to authentication service for details. |
query | A valid Common Command Language - CCL (ISO 8777) query | Requerido |
Refer to constructing CCL query for details Use the same value for aid and query as used when calling the search service |
num | The number of values for each facet | Opcional | If not provided, the default value of 15 will be used |
name | The facet to retrieve | Opcional |
If not provided then all facets will be returned Valid values:
|
Example calls
Response
The response from this service is a JSON document.
Successful response request
The following is a sample response for a successful request (HTTP status 200 OK):
{ "ActiveCatalog":0, "Facet":[ { "Name":"author", "Entry":[ { "Value:"Author Name", "Frequency":0 } ] }, { "Name":"date", "Entry":[ { "Value":"Publication Date" "Frequency":0 } ] }, { "Name":"medium" "Entry":[ { "Value":"Medium" "Frequency":18 } ] }, { "Name":"subject", "Entry":[ { "Value":"Subject", "Frequency":0 } ] }, { "Name":"catalog", "Entry":[ { "Value":"Catalog Name", "ItemCount":0 } ] } ] }
Response value glossary
Value Name | Definición |
---|---|
ActiveCatalog | An integer value indicating the number of catalogs being actively searched. A value of 0 means that the search is complete. |
Facet[n].Entry[n[.Frequency | An integer value indicating the number of items with the same facet value. |
Facet["catalog"].Entry[n].ItemCount | An integer value indicating the number of items from that catalog. |
Unsuccessful response request
The following is a sample response for an unsuccessful request.
{ "Problem"; { "Code":"PUBHG004", "Message":"Inactive search" } }
Problem codes and messages glossary
HTTP Status | Code | Type | Mensaje |
---|---|---|---|
400 Bad Request | PUBSC002, PUBHG001 | Público | Missing parameter |
400 Bad Request | PUBSC003 | Público | Invalid parameter |
401 Unauthorized | PUBSC004 | Público | Invalid aid |
401 Unauthorized | PUBSC006 | Público | User group not authorized to access the service |
404 Not Found | PUBHG005 | Público | No result |
412 Precondition Failed | PUBHG004 | Público | Inactive search |
500 Internal Server Error | PRISC001, PRIHG001 | Private | Internal error |