Hi Nilani,
I have not done this before, so you have to try it for me. Here is how I think
it can be done with demoFoxmlToSolr.xslt, instead of
<xsl:template match="/">
<add>
<doc>
<xsl:attribute name="boost">
<xsl:value-of select="$docBoost"/>
</xsl:attribute>
<!-- The following allows only active demo FedoraObjects to be indexed. -->
<xsl:if
test="foxml:digitalObject/foxml:objectProperties/foxml:proper...@name='info:fedora/fedora-system:def/model#state'
and @VALUE='Active']">
<xsl:if test="not(foxml:digitalObject/foxml:datastre...@id='METHODMAP'] or
foxml:digitalObject/foxml:datastre...@id='DS-COMPOSITE-MODEL'])">
<xsl:if test="starts-with($PID,'demo')">
<xsl:apply-templates mode="activeDemoFedoraObject"/>
</xsl:if>
</xsl:if>
</xsl:if>
</doc>
</add>
</xsl:template>
<xsl:template match="/foxml:digitalObject" mode="activeDemoFedoraObject">
...
do
<xsl:template match="/">
<xsl:attribute name="boost">
<xsl:value-of select="$docBoost"/>
</xsl:attribute>
<!-- The following allows only active demo FedoraObjects to be indexed. -->
<xsl:if
test="foxml:digitalObject/foxml:objectProperties/foxml:proper...@name='info:fedora/fedora-system:def/model#state'
and @VALUE='Active']">
<xsl:if test="not(foxml:digitalObject/foxml:datastre...@id='METHODMAP'] or
foxml:digitalObject/foxml:datastre...@id='DS-COMPOSITE-MODEL'])">
<xsl:if test="starts-with($PID,'demo')">
<xsl:apply-templates mode="activeDemoFedoraObject"/>
</xsl:if>
</xsl:if>
</xsl:if>
<!-- The following allows inactive demo FedoraObjects to be deleted from the
index. -->
<xsl:if
test="foxml:digitalObject/foxml:objectProperties/foxml:proper...@name='info:fedora/fedora-system:def/model#state'
and @VALUE='Inactive']">
<xsl:if test="not(foxml:digitalObject/foxml:datastre...@id='METHODMAP'] or
foxml:digitalObject/foxml:datastre...@id='DS-COMPOSITE-MODEL'])">
<xsl:if test="starts-with($PID,'demo')">
<xsl:apply-templates mode="inactiveDemoFedoraObject"/>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="/foxml:digitalObject" mode="activeDemoFedoraObject">
<add>
<doc>
...
</doc>
</add>
</xsl:template>
<xsl:template match="/foxml:digitalObject" mode="inactiveDemoFedoraObject">
<xsl:comment> name="PID" This is a hack, because the code requires that to be
present </xsl:comment>
<delete>
<id><xsl:value-of select="$PID"/></id>
</delete>
</xsl:template>
Let me know the result, please.
Best,
Gert
On 14/12/2010, at 14.26, Nilani Ganeshwaran wrote:
Hi Gert
Thank you very much for your reply.
I have used two methods mentioned by you before, but both are not helpful for
my current problem.
I explain my problem bit more.
I am using gsearch to intermediate fedora and solr. Only active objects and
indexed in solr. If an object is changed from active to inactive I need to
delete that record from solr.
How can I do this? Is there any way to use indexing xslt?
Regards
Nilani
Nilani Ganeshwaran
eScholar Software Developer
The University of Manchester
Tel: 0161 2758728
From: Gert Schmeltz Pedersen [mailto:[email protected]]
Sent: 14 December 2010 13:07
To: Nilani Ganeshwaran
Cc:
[email protected]<mailto:[email protected]>
Subject: Re: [fcrepo-dev] Deleting one index document
Hi Nilani
See http://lucene.apache.org/solr/tutorial.html#Deleting+Data
or use gsearch updateIndex deletePid
Regards
Gert
On 14/12/2010, at 12.46, Nilani Ganeshwaran wrote:
Hi Gert
I am using gsearch 2.2 with solr 1.4.
Indexing xslt (foxmlToSolr.xslt) is adding documents to index.
I want to delete one exiting document from the index, is there any way that I
can do it ?
Regards
Nilani
Nilani Ganeshwaran
eScholar Software Developer
Red 1.1, The John Rylands University Library
The University of Manchester
Oxford Road, Manchester, M13 9PP
Tel: 0161 2758728
Web: http://www.escholar.manchester.ac.uk
<ATT00001.c><ATT00002.c>
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Fedora-commons-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers