From ffbdf85d13634634e85cc7989db72cfd80f1dcfa Mon Sep 17 00:00:00 2001 From: "Gantner, Florian Klaus" Date: Fri, 8 Mar 2024 15:23:10 +0100 Subject: [PATCH] search facet openByDefault documentation https://github.com/DSpace/DSpace/issues/9404 --- search-endpoint.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/search-endpoint.md b/search-endpoint.md index e388fa94..7916c6eb 100644 --- a/search-endpoint.md +++ b/search-endpoint.md @@ -278,6 +278,7 @@ The returned JSON response will be like: "name" : "author", "facetType": "text", "facetLimit": 10, + "openByDefault": false, "_embedded" : { "values" : [ { @@ -312,6 +313,7 @@ The returned JSON response will be like: "name" : "subject", "facetType": "hierarchical", "facetLimit": 10, + "openByDefault": false, "_embedded" : { "values" : [ { @@ -346,6 +348,7 @@ The returned JSON response will be like: "name": "dateIssued", "facetType": "date", "facetLimit": 10, + "openByDefault": false, "minValue": "1940-03-15", "maxValue": "2017-11-06", "_links": { @@ -435,6 +438,8 @@ This endpoint returns a list of configured facets with their respective values. Some facets can be configured in the `discovery.xml` file to expose minimum and maximum values. In the example below the `dateIssued` filter has this configuration enabled. +Some facets can be configured in the `discovery.xml` to be presented initially opened/active by the `openByDefault` value. + The returned JSON response will be like: ```json @@ -471,6 +476,7 @@ The returned JSON response will be like: "name" : "author", "facetType": "text", "facetLimit": 5, + "openByDefault": false, "_links": { "next" : { "href": "/api/discover/facets/author?query=my+query&scope=9076bd16-e69a-48d6-9e41-0238cb40d863&f.title=abcd,notcontains&f.author=1234,authority&page=1&size=5" @@ -519,6 +525,7 @@ The returned JSON response will be like: "name" : "subject", "facetType": "text", "facetLimit": 5, + "openByDefault": false, "_links": { "next" : { "href": "/api/discover/facets/subject?query=my+query&scope=9076bd16-e69a-48d6-9e41-0238cb40d863&f.title=abcd,notcontains&f.author=1234,authority&page=1&size=5" @@ -569,6 +576,7 @@ The returned JSON response will be like: "facetLimit": 10, "minValue": "1940-03-15", "maxValue": "2017-11-06", + "openByDefault": false, "_links": { "self": { "href": "/api/discover/facets/dateIssued?query=my+query&scope=9076bd16-e69a-48d6-9e41-0238cb40d863&f.title=abcd,notcontains&f.author=1234,authority" @@ -671,6 +679,7 @@ The JSON response document is as follow "name" : "author", "facetType": "text", "facetLimit": 10, + "openByDefault": false, "_links": { "self": { "href": "/api/discover/facets/author" @@ -681,6 +690,7 @@ The JSON response document is as follow "name" : "subject", "facetType": "hierarchical", "facetLimit": 10, + "openByDefault": false, "_links": { "self": { "href": "/api/discover/facets/subject" @@ -690,6 +700,7 @@ The JSON response document is as follow { "name" : "dateIssued", "facetType": "date", + "openByDefault": false, "facetLimit": 10, "hasMinMaxValues": true, "_links": { @@ -702,6 +713,7 @@ The JSON response document is as follow "name" : "has_content_in_original_bundle", "facetType": "standard", "facetLimit": 2, + "openByDefault": false, "_links": { "self": { "href": "https://demo.dspace.org/server/api/discover/facets/has_content_in_original_bundle" @@ -722,6 +734,17 @@ This endpoint returns a list of values that correspond to the given facet name. * `f.<:filter-name>=<:filter-value>,<:filter-operator>`: Advanced search filter that has to be used to filter the result set. The `filter-name` and `filter-operator` must match a value returned by parent search endpoint (see above). For example `f.author=5df05073-3be7-410d-8166-e254369e4166,authority` or `f.title=rainbows,notcontains`. If the filter operator is absent or invalid a "422 Unprocessable Entity" will be returned. * `page`, `size` & `sort` [see pagination](README.md#Pagination): the sort name be "count" (results ordered descending by the number of matching records) or "index" (results order alphabetically). +The facet contains the following information about itself: +* `name`: name of the facet +* `facetType`: type of the facet, e.g. `hierarchical`, `date`, `text`, `authority` +* `facetLimit`: maximum number of entries on the facet page +* `hasMore`: if the facet has more entries on the next facet page +* `openByDefault`: if the facet is meant to be presented initially opened/active by the `openByDefault` value. +* `minValue`: if configured to expose minimum and maximum values `exposeMinAndMaxValue` this is the minimum value +* `maxValue`: if configured to expose minimum and maximum values `exposeMinAndMaxValue` this is the maximum value + + + Example: TODO The returned JSON response will be like: @@ -754,6 +777,7 @@ The returned JSON response will be like: "name" : "author", "facetType": "text", "facetLimit": 10, + "openByDefault": false, "_embedded" : { "values" : [ { @@ -1052,6 +1076,7 @@ Example "name" : "namedresourcetype", "facetType" : "text", "facetLimit" : 10, + "openByDefault": false, "_links" : { "self" : { "href" : "https://demo.dspace.org/server/api/discover/facets/namedresourcetype?configuration=workspace" @@ -1086,6 +1111,7 @@ Example "name" : "itemtype", "facetType" : "text", "facetLimit" : 10, + "openByDefault": false "_links" : { "self" : { "href" : "https://demo.dspace.org/server/api/discover/facets/itemtype?configuration=workspace" @@ -1098,6 +1124,7 @@ Example "name" : "dateIssued", "facetType" : "date", "facetLimit" : 5, + "openByDefault": false "minValue" : "1990-02-13", "maxValue" : "2010-11-03", "_links" : { @@ -1242,6 +1269,7 @@ Example "name" : "namedresourcetype", "facetType" : "text", "facetLimit" : 10, + "openByDefault": false, "_links" : { "self" : { "href" : "http://localhost/api/discover/facets/namedresourcetype?configuration=workflow" @@ -1267,6 +1295,7 @@ Example "name" : "itemtype", "facetType" : "text", "facetLimit" : 10, + "openByDefault": false, "_links" : { "self" : { "href" : "http://localhost/api/discover/facets/itemtype?configuration=workflow" @@ -1279,6 +1308,7 @@ Example "name" : "dateIssued", "facetType" : "date", "facetLimit" : 5, + "openByDefault": false, "minValue" : "1990-02-13", "maxValue" : "2010-11-03", "_links" : { @@ -1306,6 +1336,7 @@ Example "name" : "submitter", "facetType" : "text", "facetLimit" : 10, + "openByDefault": false, "_links" : { "self" : { "href" : "http://localhost/api/discover/facets/submitter?configuration=workflow"