Skip to content

Commit ffbdf85

Browse files
search facet openByDefault documentation
DSpace/DSpace#9404
1 parent 02764cb commit ffbdf85

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

search-endpoint.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ The returned JSON response will be like:
278278
"name" : "author",
279279
"facetType": "text",
280280
"facetLimit": 10,
281+
"openByDefault": false,
281282
"_embedded" : {
282283
"values" : [
283284
{
@@ -312,6 +313,7 @@ The returned JSON response will be like:
312313
"name" : "subject",
313314
"facetType": "hierarchical",
314315
"facetLimit": 10,
316+
"openByDefault": false,
315317
"_embedded" : {
316318
"values" : [
317319
{
@@ -346,6 +348,7 @@ The returned JSON response will be like:
346348
"name": "dateIssued",
347349
"facetType": "date",
348350
"facetLimit": 10,
351+
"openByDefault": false,
349352
"minValue": "1940-03-15",
350353
"maxValue": "2017-11-06",
351354
"_links": {
@@ -435,6 +438,8 @@ This endpoint returns a list of configured facets with their respective values.
435438

436439
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.
437440

441+
Some facets can be configured in the `discovery.xml` to be presented initially opened/active by the `openByDefault` value.
442+
438443
The returned JSON response will be like:
439444

440445
```json
@@ -471,6 +476,7 @@ The returned JSON response will be like:
471476
"name" : "author",
472477
"facetType": "text",
473478
"facetLimit": 5,
479+
"openByDefault": false,
474480
"_links": {
475481
"next" : {
476482
"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:
519525
"name" : "subject",
520526
"facetType": "text",
521527
"facetLimit": 5,
528+
"openByDefault": false,
522529
"_links": {
523530
"next" : {
524531
"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:
569576
"facetLimit": 10,
570577
"minValue": "1940-03-15",
571578
"maxValue": "2017-11-06",
579+
"openByDefault": false,
572580
"_links": {
573581
"self": {
574582
"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
671679
"name" : "author",
672680
"facetType": "text",
673681
"facetLimit": 10,
682+
"openByDefault": false,
674683
"_links": {
675684
"self": {
676685
"href": "/api/discover/facets/author"
@@ -681,6 +690,7 @@ The JSON response document is as follow
681690
"name" : "subject",
682691
"facetType": "hierarchical",
683692
"facetLimit": 10,
693+
"openByDefault": false,
684694
"_links": {
685695
"self": {
686696
"href": "/api/discover/facets/subject"
@@ -690,6 +700,7 @@ The JSON response document is as follow
690700
{
691701
"name" : "dateIssued",
692702
"facetType": "date",
703+
"openByDefault": false,
693704
"facetLimit": 10,
694705
"hasMinMaxValues": true,
695706
"_links": {
@@ -702,6 +713,7 @@ The JSON response document is as follow
702713
"name" : "has_content_in_original_bundle",
703714
"facetType": "standard",
704715
"facetLimit": 2,
716+
"openByDefault": false,
705717
"_links": {
706718
"self": {
707719
"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.
722734
* `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.
723735
* `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).
724736

737+
The facet contains the following information about itself:
738+
* `name`: name of the facet
739+
* `facetType`: type of the facet, e.g. `hierarchical`, `date`, `text`, `authority`
740+
* `facetLimit`: maximum number of entries on the facet page
741+
* `hasMore`: if the facet has more entries on the next facet page
742+
* `openByDefault`: if the facet is meant to be presented initially opened/active by the `openByDefault` value.
743+
* `minValue`: if configured to expose minimum and maximum values `exposeMinAndMaxValue` this is the minimum value
744+
* `maxValue`: if configured to expose minimum and maximum values `exposeMinAndMaxValue` this is the maximum value
745+
746+
747+
725748
Example: TODO
726749

727750
The returned JSON response will be like:
@@ -754,6 +777,7 @@ The returned JSON response will be like:
754777
"name" : "author",
755778
"facetType": "text",
756779
"facetLimit": 10,
780+
"openByDefault": false,
757781
"_embedded" : {
758782
"values" : [
759783
{
@@ -1052,6 +1076,7 @@ Example
10521076
"name" : "namedresourcetype",
10531077
"facetType" : "text",
10541078
"facetLimit" : 10,
1079+
"openByDefault": false,
10551080
"_links" : {
10561081
"self" : {
10571082
"href" : "https://demo.dspace.org/server/api/discover/facets/namedresourcetype?configuration=workspace"
@@ -1086,6 +1111,7 @@ Example
10861111
"name" : "itemtype",
10871112
"facetType" : "text",
10881113
"facetLimit" : 10,
1114+
"openByDefault": false
10891115
"_links" : {
10901116
"self" : {
10911117
"href" : "https://demo.dspace.org/server/api/discover/facets/itemtype?configuration=workspace"
@@ -1098,6 +1124,7 @@ Example
10981124
"name" : "dateIssued",
10991125
"facetType" : "date",
11001126
"facetLimit" : 5,
1127+
"openByDefault": false
11011128
"minValue" : "1990-02-13",
11021129
"maxValue" : "2010-11-03",
11031130
"_links" : {
@@ -1242,6 +1269,7 @@ Example
12421269
"name" : "namedresourcetype",
12431270
"facetType" : "text",
12441271
"facetLimit" : 10,
1272+
"openByDefault": false,
12451273
"_links" : {
12461274
"self" : {
12471275
"href" : "http://localhost/api/discover/facets/namedresourcetype?configuration=workflow"
@@ -1267,6 +1295,7 @@ Example
12671295
"name" : "itemtype",
12681296
"facetType" : "text",
12691297
"facetLimit" : 10,
1298+
"openByDefault": false,
12701299
"_links" : {
12711300
"self" : {
12721301
"href" : "http://localhost/api/discover/facets/itemtype?configuration=workflow"
@@ -1279,6 +1308,7 @@ Example
12791308
"name" : "dateIssued",
12801309
"facetType" : "date",
12811310
"facetLimit" : 5,
1311+
"openByDefault": false,
12821312
"minValue" : "1990-02-13",
12831313
"maxValue" : "2010-11-03",
12841314
"_links" : {
@@ -1306,6 +1336,7 @@ Example
13061336
"name" : "submitter",
13071337
"facetType" : "text",
13081338
"facetLimit" : 10,
1339+
"openByDefault": false,
13091340
"_links" : {
13101341
"self" : {
13111342
"href" : "http://localhost/api/discover/facets/submitter?configuration=workflow"

0 commit comments

Comments
 (0)