Skip to content

Commit 9184564

Browse files
adam-murrayCristinaRO
authored andcommitted
feat: Add facet options to search
Signed-off-by: Cristina <[email protected]>
1 parent 5b131bd commit 9184564

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/ml-config/databases/content-database.json

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"path-namespace" : [ {
66
"prefix": "akn",
77
"namespace-uri" : "http://docs.oasis-open.org/legaldocml/ns/akn/3.0"
8+
},
9+
{
10+
"prefix": "uk",
11+
"namespace-uri" : "https://caselaw.nationalarchives.gov.uk/akn"
812
} ],
913
"range-path-index" : [ {
1014
"scalar-type" : "date",
@@ -16,6 +20,12 @@
1620
"path-expression" : "akn:akomaNtoso/akn:judgment/akn:meta/akn:identification/akn:FRBRManifestation/akn:FRBRdate[@name='transform']/@date",
1721
"range-value-positions" : false,
1822
"invalid-values": "ignore"
23+
}, {
24+
"scalar-type": "string",
25+
"path-expression" : "//akn:proprietary/uk:court",
26+
"collation" : "http://marklogic.com/collation/",
27+
"range-value-positions" : false,
28+
"invalid-values": "ignore"
1929
} ],
2030
"range-element-index": [ {
2131
"scalar-type" : "dateTime",

src/main/ml-modules/root/judgments/search/search-v2.xqy

+6
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ let $scope := 'documents'
167167
let $search-options := <options xmlns="http://marklogic.com/appservices/search">
168168
<fragment-scope>{ $scope }</fragment-scope>
169169
<search-option>unfiltered</search-option>
170+
<constraint name="court">
171+
<range type="xs:string" facet="true">
172+
<facet-option>limit=10</facet-option>
173+
<path-index xmlns:akn="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn">//akn:proprietary/uk:court</path-index>
174+
</range>
175+
</constraint>
170176
{ $sort-order }
171177
<extract-document-data xmlns:akn="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn">
172178
<extract-path>//akn:FRBRWork/akn:FRBRdate</extract-path>

0 commit comments

Comments
 (0)