Hi Federica,
What is actually generated by the indexing stylesheet?
Best,
Gert
On 16/05/2011, at 11.25, Federica Bertozzi wrote:
Hi,
I use GSerach with Fedora 3.3, synchronized with JMS.
How can I remove from index an object when its state change from Active to
Deleted?
I add this code (I take this from here
http://fedora-commons.1317035.n2.nabble.com/fcrepo-dev-Deleting-one-index-document-tc5835362.html#none,
which treated a similar problem, with inactive instead of deleted state) in
fedoragsearch/WEB-INF/classes/config/index/BasicIndex/basicFoxmlToLucene.xslt,
but it doesn't work:
...
<xsl:template match="/">
<IndexDocument>
<!-- The PID attribute is mandatory for indexing to work -->
<xsl:attribute name="PID">
<xsl:value-of select="$PID"/>
</xsl:attribute>
<xsl:attribute name="boost">
<xsl:value-of select="$docBoost"/>
</xsl:attribute>
<!-- The following allows only active FedoraObjects to be indexed.
-->
...
<!-- The following allows deleted mag FedoraObjects to be deleted
from the index. -->
<xsl:if
test="foxml:digitalObject/foxml:objectProperties/foxml:property[@NAME='info:fedora/fedora-system:def/model#state'
and @VALUE='Deleted']">
<xsl:if
test="not(foxml:digitalObject/foxml:datastream[@ID='METHODMAP'] or
foxml:digitalObject/foxml:datastream[@ID='DS-COMPOSITE-MODEL'])">
<xsl:if test="starts-with($PID,'mag:')">
<xsl:apply-templates mode="deletedFedoraObject"/>
</xsl:if>
</xsl:if>
</xsl:if>
</IndexDocument>
</xsl:template>
...
<xsl:template match="/foxml:digitalObject" mode="deletedFedoraObject">
<delete>
<id><xsl:value-of select="$PID"/></id>
</delete>
</xsl:template>
...
Thanks
--
Federica
<ATT00001.c><ATT00002.c>
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users