Commit ec54c3e6 authored by bettin5's avatar bettin5
Browse files

required doctype

parent e50498ad
......@@ -46,7 +46,6 @@ As the TEI file is processed, the TEI XML structure is split into pages using
the page beginning elements (<pb/>).
Refer to comments in the code to understand the used algorithm.
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
......@@ -74,18 +73,16 @@ Refer to comments in the code to understand the used algorithm.
<xsl:apply-templates select="//body/listBibl" />
</doc>
<xsl:apply-templates select="text" mode="page_splitting" />
</add>
</add>
</xsl:template>
<!-- check if it is the right output -->
<!-- -->
<xsl:template match="listBibl">
<doc>
<xsl:for-each select="bibl">
<doc>
<field name="literatur_id">
<field name="id">
<xsl:value-of select="./@xml:id"/>
</field>
<field name="doctype">literatur</field>
<xsl:for-each select="relatedItem">
<field name="uri">
<xsl:value-of select="ref/@target"/>
......@@ -101,15 +98,16 @@ Refer to comments in the code to understand the used algorithm.
<xsl:value-of select="./normalize-space()"/>
</field>
</xsl:for-each>
<xsl:for-each select="title">
<field name="title_literatur">
<xsl:value-of select="./normalize-space()"/>
</field>
</xsl:for-each>
<field name="edition">
<xsl:value-of select="edition"/>
</field>
<field name="title">
<xsl:for-each select="title">
<xsl:value-of select="./normalize-space()"/>
</xsl:for-each>
</field>
<xsl:if test="edition!=''">
<field name="edition">
<xsl:value-of select="edition/normalize-space()"/>
</field>
</xsl:if>
<field name="pub_place">
<xsl:value-of select="pubPlace/name"/>
</field>
......@@ -131,8 +129,6 @@ Refer to comments in the code to understand the used algorithm.
</xsl:for-each>
</doc>
</xsl:for-each>
</doc>
</xsl:template>
......@@ -252,11 +248,19 @@ Refer to comments in the code to understand the used algorithm.
</field>
</xsl:template>
<xsl:template match="text">
<field name="id">
<xsl:value-of select="@xml:id" />
</field>
<xsl:choose>
<xsl:when test="./@xml:id">
<field name="id">
<xsl:value-of select="./@xml:id"/>
</field>
</xsl:when>
<xsl:otherwise>
<field name="id">
<xsl:value-of select="substring-after(substring-before(document-uri(/), '.xml'), 'Lit_Bearbeitung/')" /> <!--dirty solution not safe with other dirs-->
</field>
</xsl:otherwise>
</xsl:choose>
<field name="doctype">article</field>
<field name="number_of_pages">
<xsl:value-of select="count(//pb)" />
......
<?xml version="1.0" encoding="UTF-8"?>
<schema name="gfl" version="1.5">
<!-- TODO uniq id when all data or plain A -->
<uniqueKey>id</uniqueKey>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"
indexed="true"
......@@ -44,23 +44,21 @@
</analyzer>
</fieldType>
<field name="id" type="string" /><!--TODO required-->
<field name="literatur" type="string" required="false" multiValued="true" /><!--TODO remove-->
<field name="literatur_id" type="string" multiValued="true"/>
<field name="id" type="string" required="true"/>
<!-- 'article' or 'page' or 'literatur'-->
<field name="doctype" type="string" required="true"/>
<!-- for doctype 'literatur' -->
<field name="uri" type="string" multiValued="true"/>
<field name="authors" type="string" multiValued="true" />
<field name="editor" type="string" multiValued="true" />
<field name="title_literatur" type="string" multiValued="true"/>
<field name="edition" type="string" multiValued="true"/>
<field name="pub_place" type="string" multiValued="true"/>
<field name="publisher" type="string" multiValued="true"/>
<field name="pub_date" type="string" multiValued="true"/>
<field name="idno" type="string" multiValued="true"/>
<field name="idno" type="string" />
<field name="refs" type="string" multiValued="true" />
<!-- 'article' or 'page' -->
<field name="doctype" type="string" required="false" /><!--TODO required-->
<!-- for doctype 'page' -->
<field name="article_id" type="string" />
......@@ -76,7 +74,7 @@
<field name="fulltext" type="text_de" multiValued="false" />
<field name="fulltext_html" type="text_de" multiValued="false" />
<field name="short_title" type="text_de" multiValued="false" />
<field name="title" type="text_de" multiValued="false" />
<field name="title" type="text_de" multiValued="true" /><!--TODO multivalue = "false"-->
<field name="author" type="text_de" multiValued="true" />
<field name="recipient" type="text_de" multiValued="false" />
<field name="origin_place" type="text_de" multiValued="false" />
......@@ -92,7 +90,7 @@
<field name="all_header_fields" type="text_de" multiValued="true" />
<copyField source="id" dest="all_header_fields" />
<copyField source="short_title" dest="all_header_fields" />
<copyField source="title" dest="all_header_fields" />
<copyField source="title" dest="all_header_fields" multiValued="true"/>
<copyField source="author" dest="all_header_fields" />
<copyField source="recipient" dest="all_header_fields" />
<copyField source="origin_place" dest="all_header_fields" />
......@@ -111,7 +109,7 @@
<copyField source="origin_place" dest="origin_place_sort" />
<field name="destination_place_sort" type="string" />
<copyField source="destination_place" dest="destination_place_sort" />
<field name="title_sort" type="string" />
<field name="title_sort" type="string" multiValued="true"/>
<copyField source="title" dest="title_sort" />
<field name="short_title_sort" type="string" />
<copyField source="short_title" dest="short_title_sort" />
......
#Written by CorePropertiesLocator
#Mon Mar 02 08:42:22 UTC 2020
#Wed Mar 04 12:42:22 UTC 2020
schema=schema.xml
dataDir=data
name=gfloffline
name=gfl
config=solrconfig.xml
#Written by CorePropertiesLocator
#Mon Mar 02 08:42:22 UTC 2020
#Wed Mar 04 12:42:22 UTC 2020
schema=schema.xml
dataDir=data
name=gfl
name=gfloffline
config=solrconfig.xml
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment