[GeoNetwork-devel] Perform search on new schema ?

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&quot;

blockDefault=&quot;\#all&quot;&gt;

&lt;element name=&quot;MD\_Data&quot; type=&quot;MD\_DataType&quot;/&gt;

&lt;complexType name=&quot;MD\_DataType&quot;&gt;

    &lt;sequence&gt;

        &lt;element ref=&quot;myData1&quot; /&gt;

        &lt;element ref=&quot;myData2&quot; /&gt;

        &lt;element ref=&quot;myData3&quot; /&gt;

    &lt;/sequence&gt;

&lt;/complexType&gt;

&lt;element name=&quot;myData1&quot; type=&quot;string&quot;/&gt;

&lt;element name=&quot;myData2&quot; type=&quot;string&quot;/&gt;

&lt;element name=&quot;myData3&quot; type=&quot;string&quot;/&gt;

</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&quot;&gt;
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
/>

&lt;xsl:template match=&quot;/&quot;&gt;
    &lt;Document&gt;

        &lt;xsl:for\-each select=&quot;/MD\_Data/myData1&quot;&gt;
            &lt;Field name=&quot;myData1&quot; string=&quot;\{string\(\.\)\}&quot; store=&quot;true&quot;

index="true" token="false"/>
</xsl:for-each>

        &lt;xsl:for\-each select=&quot;/MD\_Data/myData2&quot;&gt;
            &lt;Field name=&quot;myData2&quot; string=&quot;\{string\(\.\)\}&quot; store=&quot;true&quot;

index="true" token="false"/>
</xsl:for-each>

        &lt;xsl:for\-each select=&quot;/MD\_Data/myData3&quot;&gt;
            &lt;Field name=&quot;myData3&quot; string=&quot;\{string\(\.\)\}&quot; store=&quot;true&quot;

index="true" token="false"/>
</xsl:for-each>

    &lt;/Document&gt;
&lt;/xsl:template&gt;

</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