-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch-fields.xml
101 lines (95 loc) · 4.14 KB
/
search-fields.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!--
This file contains field definitions for the search and browse functions of the site.
The definition controls three aspects of the fields:
1 the field types in the Solr schema (how Solr should interpret the content)
2 the field content (how the fields are populated from the TEI XML)
3 the field display (how they are queried and displayed)
The @name attribute defines the name of the field in Solr and in the HTTP query URIs. Use lower case, single token with no spaces.
The @label attribute provides the field's label in the UI. Fields with no @label will not appear in the UI at all.
The @type attribute controls how the content of the field is indexed by Solr: a type of "facet" causes the text to be treated as a single token;
as does a type of "sort". Otherwise Solr treats the field as free text, and performs various kinds of tokenisation, stemming, etc, on it.
The @xpath attribute defines the content of the field.
An XPath which returns a sequence of more than one item will produce a multi-valued field.
The TEI namespace is the default.
The XPath version supported is 3.1.
-->
<fields>
<!--
This field defines an "id" field which must identify the text uniquely and persistently. It is used by Solr as a unique identifier.
-->
<field name="id" xpath="/TEI/@xml:id"/>
<!--
This field defines a "title" field containing a composite value aggregated from various components of the msIdentifier.
-->
<field name="title"
label="Title"
xpath="
let $id := /TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier
return string-join(
(
$id/settlement,
concat($id/collection, ' ', $id/idno),
$id/repository,
$id/institution
)[normalize-space()],
', '
)
"
/>
<!--
This field defines a text field to contain the brief description of the text as given in the manuscript description.
-->
<field name="description" label="Description"
xpath="/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msContents/msItem/note[@type='description']"
/>
<!--
This field defines an "institution" facet whose value is the name of the institution given in the manuscript description.
-->
<field name="institution" label="Institution" xpath="/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/institution" type="facet"/>
<!--
This field defines a "repository" facet whose value is the name of the repository given in the manuscript description.
-->
<field name="repository" label="Repository" xpath="/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/repository" type="facet"/>
<!--
This field defines a "symbol" facet whose values come from the <char> elements in the header.
The value of the facet contains both the symbol itself and its textual name, e.g. "♂ IRON (MARS)".
-->
<field
name="symbol"
label="Symbol"
xpath="
for $character
in /TEI/teiHeader/encodingDesc/charDecl/char[charProp[localName='type']/value='symbol']
return concat($character/mapping, ' ', $character/charName)
"
type="facet"/>
<!--
This field defines a "person" facet which uses the string content of <persName> elements, normalized to exclude any text
which is enclosed in <orig> or <abbrev> elements.
-->
<field
name="person"
label="People"
xpath="for $person-name in //persName return string-join($person-name//text()[not(ancestor::orig)][not(ancestor::abbrev)])"
type="facet"/>
<!--
This field, called "sort", is used as a sort key of last resort when displaying search results.
When two or more documents are equally relevant to a search (which is the case, for instance, with a blank search,
which returns all documents), then the documents will be sorted according to the settlement, region, collection, and idno.
The field is not intended to be used for searching; only for sorting.
-->
<field
name="sort"
xpath="
string-join(
(
/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/settlement,
/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier[country/@key='US']/region/@key,
/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/altIdentifier/idno[@type='collection'],
/TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/idno
),
' '
)
"
type="sort"/>
</fields>