Hi,
I have created a new schema for metadata. It works very well to insert new metadata using GeoNetwork.
Now, I want to perform searches on my new data using the fields of my new schema.
For example, I have defined the following schema :
schema.xsd
<schema xmlns=“http://www.w3.org/2001/XMLSchema”
blockDefault=“#all”>
I have indexed this schema using its “index-fields.xsl” file :
<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”>
<xsl:output method=“xml” version=“1.0” encoding=“UTF-8” indent=“yes” />
<xsl:template match=“/”>
<xsl:for-each select=“/MD_Data/myData1”>
</xsl:for-each>
<xsl:for-each select=“/MD_Data/myData2”>
</xsl:for-each>
<xsl:for-each select=“/MD_Data/myData3”>
</xsl:for-each>
</xsl:stylesheet>
I have checked in Lucene index: values are correctly indexed with “myData1”, “myData2” and “myData3” fields.
Now, I want to perform search to retrieve data. For example, using the search service like that : http://myGeoNetwork:myPort/srv/en/xml.search?myData2=oneValue.
What I need to do to retrieve data using GeoNetwork search service ?
Best regards
Hi Rudy
2011/5/13 Rudy Commenge <rudywi.devel@anonymised.com>:
Hi,
I have created a new schema for metadata. It works very well to insert new
metadata using GeoNetwork.
Now, I want to perform searches on my new data using the fields of my new
schema.
For example, I have defined the following schema :
schema.xsd
<schema xmlns="http://www.w3.org/2001/XMLSchema"
blockDefault="\#all">
<element name="MD\_Data" type="MD\_DataType"/>
<complexType name="MD\_DataType">
<sequence>
<element ref="myData1" />
<element ref="myData2" />
<element ref="myData3" />
</sequence>
</complexType>
<element name="myData1" type="string"/>
<element name="myData2" type="string"/>
<element name="myData3" type="string"/>
</schema>
I have indexed this schema using its "index-fields.xsl" file :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
/>
<xsl:template match="/">
<Document>
<xsl:for\-each select="/MD\_Data/myData1">
<Field name="myData1" string="\{string\(\.\)\}" store="true"
index="true" token="false"/>
</xsl:for-each>
<xsl:for\-each select="/MD\_Data/myData2">
<Field name="myData2" string="\{string\(\.\)\}" store="true"
index="true" token="false"/>
</xsl:for-each>
<xsl:for\-each select="/MD\_Data/myData3">
<Field name="myData3" string="\{string\(\.\)\}" store="true"
index="true" token="false"/>
</xsl:for-each>
</Document>
</xsl:template>
</xsl:stylesheet>
I have checked in Lucene index: values are correctly indexed with
"myData1", "myData2" and "myData3" fields.
Now, I want to perform search to retrieve data. For example, using the
search service like that :
http://myGeoNetwork:myPort/srv/en/xml.search?myData2=oneValue.
What I need to do to retrieve data using GeoNetwork search service ?
If you use trunk, this should work without changes as far as your
lucene fields are not reserved GeoNetwork field names and you want to
make simple queries (ie. not range query).
In 2.6.x branches, you probably have to change LuceneQueryBuilder
Cheers.
Francois
Best regards
------------------------------------------------------------------------------
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
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork