Skip to content

Commit e1191e9

Browse files
author
François Prunayre
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 03ab768 + 0a0f6b2 commit e1191e9

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

core/src/main/java/org/fao/geonet/kernel/search/LuceneSearcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ private void computeQuery(ServiceContext srvContext, Element request, ServiceCon
623623
String[] items = summaryItemsEl.getValue().split(",");
624624

625625
for (String item : items) {
626-
if (item.equals("any")) {
626+
if (item.startsWith("any")) {
627627
tmpConfig = _summaryConfig;
628628
break;
629629
}

web-client/src/main/resources/apps/js/GeoNetwork/lib/GeoNetwork/form/OpenSearchSuggestionTextField.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ GeoNetwork.form.OpenSearchSuggestionTextField = Ext.extend(Ext.form.ComboBox, {
8282
* Default any (ie. full text search).
8383
*/
8484
field: 'any',
85+
/** api: config[suggestionField]
86+
* ``String`` Optional, GeoNetwork Lucene field to use for suggestion.
87+
* If undefined, field is used. That could be useful to restrict the suggestion
88+
* to a subset of values for this field. For example any match any text
89+
* in a metadata record, but suggestion could be limited to title, abstract, keywords
90+
* stored in the anylight field.
91+
*/
92+
suggestionField: '',
8593
/** api: config[fieldName]
8694
* ``String`` Optional, Field name.
8795
*/
@@ -155,7 +163,7 @@ GeoNetwork.form.OpenSearchSuggestionTextField = Ext.extend(Ext.form.ComboBox, {
155163
url: this.url,
156164
rootId: 1,
157165
baseParams: {
158-
field: this.field,
166+
field: this.suggestionField || this.field,
159167
// withFrequency: true, // To display frequency info
160168
sortBy: this.sortBy
161169
}

web-client/src/main/resources/apps/search/js/App.js

+1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ GeoNetwork.app = function () {
336336
new GeoNetwork.form.OpenSearchSuggestionTextField({
337337
hideLabel: true,
338338
minChars: 2,
339+
suggestionField: 'anylight',
339340
loadingText: '...',
340341
hideTrigger: true,
341342
url: catalogue.services.opensearchSuggest

web/src/main/webapp/WEB-INF/config-lucene.xml

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
-->
277277
<tokenized>
278278
<Field name="any"/>
279+
<Field name="anylight"/>
279280
<Field name="abstract"/>
280281
<Field name="title"/>
281282
<Field name="altTitle"/>

web/src/main/webapp/WEB-INF/data/config/schema_plugins/iso19139/index-fields.xsl

+22-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@
139139
<!-- not tokenized title for sorting -->
140140
<Field name="_title" string="{string(.)}" store="false" index="true"/>
141141
</xsl:for-each>
142-
143142
<xsl:for-each select="gmd:alternateTitle/gco:CharacterString">
144143
<Field name="altTitle" string="{string(.)}" store="true" index="true"/>
145144
</xsl:for-each>
@@ -189,7 +188,7 @@
189188
<xsl:for-each select="gmd:pointOfContact[1]/*/gmd:role/*/@codeListValue">
190189
<Field name="responsiblePartyRole" string="{string(.)}" store="true" index="true"/>
191190
</xsl:for-each>
192-
191+
193192
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
194193

195194
<xsl:for-each select="gmd:abstract/gco:CharacterString">
@@ -750,7 +749,27 @@
750749
</xsl:for-each>
751750
</xsl:attribute>
752751
</Field>
753-
752+
753+
<xsl:variable name="identification" select="gmd:identificationInfo//gmd:MD_DataIdentification|
754+
gmd:identificationInfo//*[contains(@gco:isoType, 'MD_DataIdentification')]|
755+
gmd:identificationInfo/srv:SV_ServiceIdentification"/>
756+
757+
758+
<Field name="anylight" store="false" index="true">
759+
<xsl:attribute name="string">
760+
<xsl:for-each
761+
select="$identification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString|
762+
$identification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString|
763+
$identification/gmd:abstract/gco:CharacterString|
764+
$identification/gmd:credit/gco:CharacterString|
765+
$identification//gmd:organisationName/gco:CharacterString|
766+
$identification/gmd:supplementalInformation/gco:CharacterString|
767+
$identification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString|
768+
$identification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gmx:Anchor">
769+
<xsl:value-of select="concat(., ' ')"/>
770+
</xsl:for-each>
771+
</xsl:attribute>
772+
</Field>
754773
<!--<xsl:apply-templates select="." mode="codeList"/>-->
755774

756775
</xsl:template>

0 commit comments

Comments
 (0)