Absolutely. Thanks for taking a look at it for me.
And in response to Gert's previous question about removing the 'demo'
requirement, yes I went ahead and replaced 'demo' with 'test' (which is how
we're prefixing our test PIDs).
The test objects are getting indexed (verified in Luke and using the GSearch
REST interface). I'm just having trouble getting our one custom datastream
properly indexed.
Here's the modified demoFoxmlToLucene.xslt file:
-------
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: demoFoxmlToLucene.xslt 7820 2008-11-05 15:05:00Z gertsp $ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exts="xalan://dk.defxws.fedoragsearch.server.GenericOperationsImpl"
exclude-result-prefixes="exts"
xmlns:zs="http://www.loc.gov/zing/srw/"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:param name="REPOSITORYNAME" select="repositoryName"/>
<xsl:param name="FEDORASOAP" select="repositoryName"/>
<xsl:param name="FEDORAUSER" select="repositoryName"/>
<xsl:param name="FEDORAPASS" select="repositoryName"/>
<xsl:param name="TRUSTSTOREPATH" select="repositoryName"/>
<xsl:param name="TRUSTSTOREPASS" select="repositoryName"/>
<xsl:variable name="PID" select="/foxml:digitalObject/@PID"/>
<xsl:variable name="docBoost" select="1.4*2.5"/> <!-- or any other
calculation, default boost is 1.0 -->
<xsl:template match="/">
<IndexDocument>
<xsl:attribute name="PID">
<xsl:value-of select="$PID"/>
</xsl:attribute>
<xsl:attribute name="boost">
<xsl:value-of select="$docBoost"/>
</xsl:attribute>
<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,'test')">
<xsl:apply-templates
mode="activeDemoFedoraObject"/>
</xsl:if>
</xsl:if>
</xsl:if>
</IndexDocument>
</xsl:template>
<xsl:template match="/foxml:digitalObject"
mode="activeDemoFedoraObject">
<IndexField IFname="PID" index="NOT_ANALYZED"
store="YES" termVector="NO" boost="2.5">
<xsl:value-of select="$PID"/>
</IndexField>
<xsl:for-each
select="foxml:objectProperties/foxml:property">
<IndexField index="NOT_ANALYZED" store="YES"
termVector="NO">
<xsl:attribute name="IFname">
<xsl:value-of
select="concat('fgs.', substring-after(@NAME,'#'))"/>
</xsl:attribute>
<xsl:value-of select="@VALUE"/>
</IndexField>
</xsl:for-each>
<xsl:for-each
select="foxml:datastream/foxml:datastreamVersion[last()]/foxml:xmlContent/oai_dc:dc/*">
<IndexField index="ANALYZED" store="YES"
termVector="YES">
<xsl:attribute name="IFname">
<xsl:value-of
select="concat('dc.', substring-after(name(),':'))"/>
</xsl:attribute>
<xsl:value-of select="text()"/>
</IndexField>
</xsl:for-each>
<xsl:for-each
select="foxml:datastream/foxml:datastreamVersion[last()]/foxml:xmlContent/custom//*">
<IndexField index="ANALYZED" store="YES"
termVector="YES">
<xsl:attribute name="IFname">
<xsl:value-of select="name()" />
</xsl:attribute>
<xsl:value-of select="text()"/>
</IndexField>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-------
Here's a more complete metadata record:
--------
<custom xsi:schemaLocation="http://url/to/schema.xml">
<titleInfo>
<title>Some Title</title>
<alternateTitle>Some Alternate Title</alternateTitle>
</titleInfo>
<creatorInfo>
<creator>Some Person</creator>
</creatorInfo>
<rightsInfo>
<documentStatus>active</documentStatus>
</rightsInfo>
<identificationInfo>
<identificationNumber>Some Number</identificationNumber>
</identificationInfo>
<descriptiveInfo>
<description>
A long description.
</description>
<backgroundInfo>
A bit of background info.
</backgroundInfo>
</descriptiveInfo>
<subjectInfo>
<keyword>Keyword 1</keyword>
<keyword>Keyword 2</keyword>
</subjectInfo>
<extent>So many pages</extent>
</custom>
---------
And that's it. Hope this helps, and thanks for any input.
Jeremy
-----Original Message-----
From: Jason Nugent [mailto:[email protected]]
Sent: Friday, May 01, 2009 2:35 PM
To: Gottwig, Jeremy M. (GSFC-272.0)[ZAI]
Cc: Fedora Users
Subject: Re: [Fedora-commons-users] Adding custom datastreams to GSearch...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jeremy,
I think I missed the early part of this thread, but would it be possible
to see the whole XML and the XSLT you're applying? Perhaps it is a
context issue. Your select attribute in your xsl:for-each block does
not begin with a slash, so it would be relative to whatever node is
considered current. You might not see any errors in that case, since
the for-each statement is valid, but simply not matching anything.
Jason
On 5/1/09 3:23 PM, Gottwig, Jeremy M. (GSFC-272.0)[ZAI] wrote:
> Also, I did dig through the warnings in the fedoragsearch.log but didn’t
> encounter anything that seemed alarming.
>
>
>
> *From:* Gottwig, Jeremy M. (GSFC-272.0)[ZAI]
> [mailto:[email protected]]
> *Sent:* Friday, May 01, 2009 1:55 PM
> *To:* Gert Schmeltz Pedersen; Fedora Users
> *Subject:* Re: [Fedora-commons-users] Adding custom datastreams to
> GSearch...
>
>
>
> Hello Gert,
>
>
>
> I really appreciate you getting back to me on this.
>
>
>
> My forgetting the <xsl:value-of select=”text()”/> was poor transcribing
> on my part. Sorry about that.
>
>
>
> Anyway, here’s what I have now:
>
>
>
> <xsl:for-each
> select="foxml:datastream/foxml:datastreamVersion[last()]/foxml:xmlContent/custom//*">
>
> <IndexField index="ANALYZED" store="YES"
> termVector="YES">
>
> <xsl:attribute name="IFname">
>
> <xsl:value-of select="name()" />
>
> </xsl:attribute>
>
> <xsl:value-of select="text()"/>
>
> </IndexField>
>
> </xsl:for-each>
>
>
>
> I’ve also tried putting modifying it to something like …/custom/author/*
> just to see if I could focus it a little more directly toward the
> grandchildren but to no avail.
>
>
>
> I have this chunk of code under the template reading: <xsl:template
> match=”/foxml:digitalObject” mode=”activeDemoFedoraObject”>. Would it
> be better off under its own template?
>
>
>
> Thanks again,
>
>
>
> Jeremy
>
>
>
>
>
> *From:* Gert Schmeltz Pedersen [mailto:[email protected]]
> *Sent:* Wednesday, April 29, 2009 4:13 AM
> *To:* Gottwig, Jeremy M. (GSFC-272.0)[ZAI]; Fedora Users
> *Subject:* RE: Adding custom datastreams to GSearch...
>
>
>
> You probably looked into demoFoxmlToLucene.xslt, where the loop path is
> …/oai_dc:dc/*, which will process all child elements of the oai_dc:dc
> element, but not grandchildren and below. If you transfer that recipe to
> a case with grandchildren like yours, you need to use …/custom//* .
> Besides, you miss the line <xsl:value-of select="text()"/> here
>
>
>
> </xsl:attribute>
>
> <xsl:value-of select="text()"/>
>
> </IndexField>
>
>
>
> If you run with debug on, you will get some info in fedoragsearch.log,
> which may help. If not, let me hear about it.
>
>
>
> Best
>
> Gert
>
>
>
> *From:* Gottwig, Jeremy M. (GSFC-272.0)[ZAI]
> [mailto:[email protected]]
> *Sent:* 28. april 2009 21:55
> *To:* Fedora Users
> *Subject:* [Fedora-commons-users] Adding custom datastreams to GSearch...
>
>
>
> I’ve been performing some tests with GSearch, but I’m having some
> difficulties indexing custom datastreams (probably because I have so
> little experience with XSLT). I’m hoping that someone might be able to
> take a look at what I’m messing with and tell me why it’s wrong and
> possibly how to fix it.
>
>
>
> Here’s the code:
>
>
>
> <xsl:for-each
> select="foxml:datastream/foxml:datastreamVersion[last()]/foxml:xmlContent/custom/*">
>
> <IndexField index="ANALYZED" store="YES" termVector="YES">
>
> <xsl:attribute name="IFname">
>
> <xsl:value-of
> select="name()" />
>
> </xsl:attribute>
>
> </IndexField>
>
> </xsl:for-each>
>
>
>
> The custom metadata is pretty simple with a layout similar to this:
>
>
>
> <custom xsi:schemaLocation=”…xml”>
>
> <title>data</title>
>
> <author>
>
> <last>data</last>
>
> <first>data</first>
>
> </author>
>
> </custom>
>
>
>
> Because this is just testing, for now I just want to dump everything
> from the datastream into the index.
>
>
>
> At present, my attempts have failed to get the datastream into the
> index. I’ve been making sure to restart Tomcat after making
> modification, and I’ve been using Luke to examine the index.
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Fedora-commons-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
- --
Jason Nugent
Systems Programmer/Database Developer
Electronic Text Centre
University of New Brunswick
[email protected]
(506) 447 3177
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFJ+0DEuI/rFPUJN7MRAq1zAJ9ixo1Z73z/FDu5qYCrQxrbmeyj1QCguqRe
v2OiOLaLXaAcrshTunMkXLA=
=6C7K
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users