Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#90 Adds global text search field that includes TEI Header nodes #100

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions search-fields.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
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 an "teiHeader" field which extracts selected text noded from the TEI header
-->
<field name="tei-header" xpath="/TEI/teiHeader//text()"/>
<!--
This field defines a "title" field containing a composite value aggregated from various components of the msIdentifier.
-->
Expand Down
26 changes: 25 additions & 1 deletion xslt/update-schema-from-field-definitions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,18 @@
<xsl:call-template name="define-field">
<xsl:with-param name="name" select=" 'diplomatic' "/>
</xsl:call-template>
<xsl:call-template name="define-field">
<xsl:with-param name="name" select=" 'tei-header' "/>
</xsl:call-template>
<!-- define a "text" field that's a copy of "introduction", "normalized", and "diplomatic" -->
<xsl:call-template name="define-field">
<xsl:with-param name="name" select=" 'text' "/>
</xsl:call-template>
<!-- define "all" field that's a copy of everything in text and select teiHeader text nodes -->
<xsl:call-template name="define-field">
<xsl:with-param name="name" select=" 'all' "/>
</xsl:call-template>

<xsl:call-template name="add-copy-field">
<xsl:with-param name="source" select=" 'introduction' "/>
<xsl:with-param name="destination" select=" 'text' "/>
Expand All @@ -86,7 +94,23 @@
<xsl:with-param name="source" select=" 'diplomatic' "/>
<xsl:with-param name="destination" select=" 'text' "/>
</xsl:call-template>

<xsl:call-template name="add-copy-field">
<xsl:with-param name="source" select=" 'introduction' "/>
<xsl:with-param name="destination" select=" 'all' "/>
</xsl:call-template>
<xsl:call-template name="add-copy-field">
<xsl:with-param name="source" select=" 'normalized' "/>
<xsl:with-param name="destination" select=" 'all' "/>
</xsl:call-template>
<xsl:call-template name="add-copy-field">
<xsl:with-param name="source" select=" 'diplomatic' "/>
<xsl:with-param name="destination" select=" 'all' "/>
</xsl:call-template>
<xsl:call-template name="add-copy-field">
<xsl:with-param name="source" select=" 'tei-header' "/>
<xsl:with-param name="destination" select=" 'all' "/>
</xsl:call-template>

<!-- define Solr fields corresponding to the facets and search fields defined in the "search-fields.xml" file -->
<xsl:for-each select="/*/fields/field">
<xsl:call-template name="define-field">
Expand Down