Skip to content

Commit

Permalink
search facet openByDefault documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
floriangantner committed Mar 8, 2024
1 parent 02764cb commit ffbdf85
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions search-endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ The returned JSON response will be like:
"name" : "author",
"facetType": "text",
"facetLimit": 10,
"openByDefault": false,
"_embedded" : {
"values" : [
{
Expand Down Expand Up @@ -312,6 +313,7 @@ The returned JSON response will be like:
"name" : "subject",
"facetType": "hierarchical",
"facetLimit": 10,
"openByDefault": false,
"_embedded" : {
"values" : [
{
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -690,6 +700,7 @@ The JSON response document is as follow
{
"name" : "dateIssued",
"facetType": "date",
"openByDefault": false,
"facetLimit": 10,
"hasMinMaxValues": true,
"_links": {
Expand All @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -754,6 +777,7 @@ The returned JSON response will be like:
"name" : "author",
"facetType": "text",
"facetLimit": 10,
"openByDefault": false,
"_embedded" : {
"values" : [
{
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -1098,6 +1124,7 @@ Example
"name" : "dateIssued",
"facetType" : "date",
"facetLimit" : 5,
"openByDefault": false
"minValue" : "1990-02-13",
"maxValue" : "2010-11-03",
"_links" : {
Expand Down Expand Up @@ -1242,6 +1269,7 @@ Example
"name" : "namedresourcetype",
"facetType" : "text",
"facetLimit" : 10,
"openByDefault": false,
"_links" : {
"self" : {
"href" : "http://localhost/api/discover/facets/namedresourcetype?configuration=workflow"
Expand All @@ -1267,6 +1295,7 @@ Example
"name" : "itemtype",
"facetType" : "text",
"facetLimit" : 10,
"openByDefault": false,
"_links" : {
"self" : {
"href" : "http://localhost/api/discover/facets/itemtype?configuration=workflow"
Expand All @@ -1279,6 +1308,7 @@ Example
"name" : "dateIssued",
"facetType" : "date",
"facetLimit" : 5,
"openByDefault": false,
"minValue" : "1990-02-13",
"maxValue" : "2010-11-03",
"_links" : {
Expand Down Expand Up @@ -1306,6 +1336,7 @@ Example
"name" : "submitter",
"facetType" : "text",
"facetLimit" : 10,
"openByDefault": false,
"_links" : {
"self" : {
"href" : "http://localhost/api/discover/facets/submitter?configuration=workflow"
Expand Down

0 comments on commit ffbdf85

Please sign in to comment.