Skip to content

Instantly share code, notes, and snippets.

@daniel-dgi
Last active August 25, 2016 21:03
Show Gist options
  • Save daniel-dgi/6001819 to your computer and use it in GitHub Desktop.
Save daniel-dgi/6001819 to your computer and use it in GitHub Desktop.
Indexing ancestors for islandora_collection_search module.
<!-- In your demoFoxmlToSolr.xslt, do this! -->
<!-- Put this with the rest of your includes -->
<xsl:include href="/path/to/islandora_transforms/hierarchy.xslt"/>
<!-- Then put this in your main template -->
<xsl:variable name="ancestors">
<xsl:call-template name="get-ancestors">
<xsl:with-param name="PID" select="/foxml:digitalObject/@PID" />
</xsl:call-template>
</xsl:variable>
<xsl:for-each select="xalan:nodeset($ancestors)//sparql:obj">
<xsl:if test="@uri != concat('info:fedora/', $PID)">
<field name="ancestors_ms"><xsl:value-of select="substring-after(@uri, '/')"/></field>
</xsl:if>
</xsl:for-each>
@ajstanley
Copy link

Should probably be
<!-- In your foxmlToSolr.xslt, do this! -->

@mshort
Copy link

mshort commented Aug 25, 2016

Like with the namespaces, traverse-graph.xslt also needs to be uncommented in foxmlToSolr.xslt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment