Hello,
I would like to know if someone has a example for adding a search capability
on the geonetwork's form.
Until now, I added a "instrument" field in searchform_advanced.xsl.
<tr>
<th class="padded">
<xsl:value-of select="/root/gui/strings/instrument"/>
</th>
<td style="padding-bottom:5px;">
<input name="instrument" id="instrument" class="content" size="20"
value="{/root/gui/searchDefaults/instrument}"/>
</td>
</tr>
Then I added the following statement in lucene.xsl:
<BooleanQuery>
...
<xsl:call-template name="textField">
<xsl-with-param name="expr" select="/request/instrument"/>
<xsl-with-param name="field" select="'title'"/>
</xsl:call-template>
...
</BooleanQuery>
I have also modified index-fields.xsl :
<xsl:for-each select="MI_AcquisitionInformation">
<xsl:for-each
select="instrument/MI_Instrument/citation/gmd:CI_Citation/gmd:title/gco:CharacterString">
<Field name="instrument" string="{string(.)}" strore="true"
index="true" token="true"/>
</xsl:for-each>
</xsl:for-each>
Then, I rebuild the lucene index using the administrator web page.
At the end, The query does not take the value of the intrument field into
account. Then I guess, I forgot to do something but I have no idea of what.
Any help will be welcomed, Thanks,
J-Christophe
Bonjour,
Then I added the following statement in lucene.xsl:
<BooleanQuery>
...
<xsl:call-template name="textField">
<xsl-with-param name="expr" select="/request/instrument"/>
<xsl-with-param name="field" select="'title'"/>
^^^^^
</xsl:call-template>
I might be wrong but I think I found an error here.
<Field name="instrument" string="{string(.)}" strore="true"
^^^^^^^^^^
index="true" token="true"/>
should it not be "instrument" instead of "select='title'" in the first
section? You select the value of the formfield with the first xpath, the
parameter is just the name of the lucene index which should be
"instrument" according to your indexing scheet.
Otherwise I see no obvious error in the procedure.
best regards
Timo
Bonjour,
Sorry, I did not write correctly. Of course, this is instrument instead of
title. Having instrument instead of title, the query does not work correctly
.
In addition, it seems I need to add :
- pars += fetchParam('instrument') in the runAdvancedSearch function located
in gn_search.js.
- setParam('instrument','') in resetAdvancedSearch function in the same file
Still looking in code,
tchuss,
J-Christophe
On Fri, Jan 29, 2010 at 2:19 PM, Timo Proescholdt <timo@anonymised.com>wrote:
Bonjour,
>
>
> Then I added the following statement in lucene.xsl:
> <BooleanQuery>
> ...
> <xsl:call-template name="textField">
> <xsl-with-param name="expr" select="/request/instrument"/>
> <xsl-with-param name="field" select="'title'"/>
^^^^^
> </xsl:call-template>
> I might be wrong but I think I found an error here.
> <Field name="instrument" string="{string(.)}" strore="true"
^^^^^^^^^^
> index="true" token="true"/>
should it not be "instrument" instead of "select='title'" in the first
section? You select the value of the formfield with the first xpath, the
parameter is just the name of the lucene index which should be
"instrument" according to your indexing scheet.
Otherwise I see no obvious error in the procedure.
best regards
Timo
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the
business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork
Hallo,
the way I would debug this is to set log4j to debug (search and lucene)
and see if the query is picked up by the geonetwork internal xml-query
format. (at some point it outputs the query in 2 slightly different XML
formats.
This is influenced by your two first modifications (lucene.xsl and the
portal search).
Then I'd check if the new field is actually indexed. you can do this e.G
by opening the index with Luke (a opensource tool for lucene index
analysis).
This applies to the index-fields.xsl.
b.t.w did you check that you modified the right index-fields.xsl? (there
is one for each format)
bonne chance
Timo
Jean-Christophe Malapert a écrit :
Bonjour,
Sorry, I did not write correctly. Of course, this is instrument instead of
title. Having instrument instead of title, the query does not work correctly
.
In addition, it seems I need to add :
- pars += fetchParam('instrument') in the runAdvancedSearch function located
in gn_search.js.
- setParam('instrument','') in resetAdvancedSearch function in the same file
Still looking in code,
tchuss,
J-Christophe
On Fri, Jan 29, 2010 at 2:19 PM, Timo Proescholdt <timo@anonymised.com>wrote:
Bonjour,
Then I added the following statement in lucene.xsl:
<BooleanQuery>
...
<xsl:call-template name="textField">
<xsl-with-param name="expr" select="/request/instrument"/>
<xsl-with-param name="field" select="'title'"/>
^^^^^
</xsl:call-template>
I might be wrong but I think I found an error here.
<Field name="instrument" string="{string(.)}" strore="true"
^^^^^^^^^^
index="true" token="true"/>
should it not be "instrument" instead of "select='title'" in the first
section? You select the value of the formfield with the first xpath, the
parameter is just the name of the lucene index which should be
"instrument" according to your indexing scheet.
Otherwise I see no obvious error in the procedure.
best regards
Timo
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the
business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork