Skip to content

Commit

Permalink
Merge branch 'fxprunayre-406-index-perfieldanalyzer' into 4.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Aug 20, 2021
2 parents 458600c + e6c45ed commit 08024f4
Show file tree
Hide file tree
Showing 23 changed files with 1,400 additions and 1,813 deletions.
25 changes: 12 additions & 13 deletions es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,23 @@ curl -X DELETE http://localhost:9200/$IDX_PREFIX-features
curl -X DELETE http://localhost:9200/$IDX_PREFIX-searchlogs
```

## Multilingual configuration (beta)
## Multilingual configuration

* Stop Elasticsearch
* Define which analyzer to use https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-analyzers.html depending on the language(s) used in your catalogue
* Build the application with the default analyzer to use (or configure it in `data/index/records.json`)
Default index is configured with analyzer for the following languages:
* English
* French
* German
* Italian

To add a new language, update the index schema in `datadir/config/index/records.json` and update the containing fields starting with `lang`.

```shell script
mvn clean install -Des.default.analyzer=french_heavy
```
First create a full text search field for the new language in the `any` object field eg. `any.langfre` and define the proper analyzer.

* Install ICU plugin (if needed)
Then add the new language like the others.

```shell script
elasticsearch-plugin install analysis-icu
```
From the admin console > tools, Delete index and reindex.

* Start Elasticsearch
* Drop and rebuild your index
Don't hesitate to propose a Pull Request with the new language.


# Production use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@


<xsl:copy-of select="gn-fn-index:add-multilingual-field('resourceCredit', mri:credit[* != ''], $allLanguages)"/>
<xsl:copy-of select="gn-fn-index:add-multilingual-field('supplementalInformation', mri:supplementalInformation[* != ''], $allLanguages)"/>
<xsl:copy-of select="gn-fn-index:add-multilingual-field('purpose', mri:purpose[* != ''], $allLanguages)"/>

<xsl:variable name="overviews"
select="mri:graphicOverview/mcc:MD_BrowseGraphic/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@

<xsl:copy-of select="gn-fn-index:add-field('Org', $org)"/>

<any><xsl:value-of select="$title"/></any>
<any><xsl:value-of select="$org"/></any>
<any><xsl:value-of select="$name"/></any>
<any><xsl:value-of select="$mail"/></any>
<any type="object">{"common": "<xsl:value-of
select="gn-fn-index:json-escape(normalize-space(.))"/>"}</any>

<xsl:for-each
select="gmd:contactInfo/*/gmd:address/*/gmd:electronicMailAddress/gco:CharacterString">
<xsl:copy-of select="gn-fn-index:add-field('email', .)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@
</xsl:apply-templates>

<xsl:copy-of select="gn-fn-index:add-multilingual-field('resourceCredit', gmd:credit, $allLanguages)"/>

<xsl:copy-of select="gn-fn-index:add-multilingual-field('supplementalInformation', gmd:supplementalInformation, $allLanguages)"/>
<xsl:copy-of select="gn-fn-index:add-multilingual-field('purpose', gmd:purpose, $allLanguages)"/>

<xsl:variable name="overviews"
select="gmd:graphicOverview/gmd:MD_BrowseGraphic/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<jsSource webappPath="/catalog/lib/angular.ext/date.js"/>
<jsSource webappPath="/catalog/lib/angular.ext/angular-floatThead.js"/>
<jsSource webappPath="/catalog/lib/tinycolor.js"/>
<jsSource webappPath="/catalog/lib/franc-min/franc-min.js"/>
<jsSource webappPath="/catalog/lib/style/bootstrap/dist/js/bootstrap.min.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/proj4js-compressed.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/openlayers/ol.js" minimize="false"/>
Expand Down Expand Up @@ -128,6 +129,7 @@
<jsSource webappPath="/catalog/lib/angular.ext/colorpicker/angularjs-color-picker.js"/>
<jsSource webappPath="/catalog/lib/jquery.ext/jquery.floatThead-slim.min.js"/>
<jsSource webappPath="/catalog/lib/tinycolor.js"/>
<jsSource webappPath="/catalog/lib/franc-min/franc-min.js"/>
<jsSource webappPath="/catalog/lib/style/bootstrap/dist/js/bootstrap.min.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/proj4js-compressed.js" minimize="false"/>
<!-- FIXME in non debug mode, 3D mode does not work when WMS layer is displayed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,40 @@ <h2>{{('ui-mod-' + m) | translate}}</h2>
{{('ui-' + key + '-help') | translate}} </p>
</div>

<div data-ng-switch-when="languageWhitelist">
<label class="control-label">{{('ui-' + key) | translate}}</label>
<table class="table table-striped table-bordered">
<tr data-ng-repeat="v in mCfg[key] track by $index">
<td>
<input type="text"
data-gn-language-picker=""
class="form-control"
id="{{key}}-{{$index}}"
data-ng-model="mCfg[key][$index]"/>
</td>
<td>
<a class="btn btn-link text-danger"
title="{{'remove' | translate}}"
data-ng-click="removeItem(mCfg[key], $index)">
<i class="fa fa-times text-danger"/>
</a>
</td>
</tr>
<tr>
<td colspan="2">
<a class="btn btn-default"
title="{{'add' | translate}}"
data-ng-click="addItem(mCfg[key], mCfg[key][mCfg[key].length - 1] * 10)">
<i class="fa fa-fw fa-plus"/>
<span translate="">add</span>
</a>
</td>
</tr>
</table>
<p class="help-block"
data-ng-show="(('ui-' + key + '-help') | translate) != ('ui-' + key + '-help')">
{{('ui-' + key + '-help') | translate}} </p>
</div>

<div data-ng-switch-when="scoreConfig">
<label class="control-label">{{('ui-' + key) | translate}}</label>
Expand Down Expand Up @@ -139,6 +173,7 @@ <h2>{{('ui-mod-' + m) | translate}}</h2>
<input type="text"
class="form-control"
id="{{iso3}}-{{$index}}"
data-gn-language-picker=""
data-ng-change="updateKey(mCfg[key], iso3, $index)"
data-ng-model="iso3"/>
<span class="input-group-addon">=</span>
Expand Down Expand Up @@ -587,18 +622,6 @@ <h3>{{('ui-' + key) | translate}}</h3>
{{('ui-' + key + '-help') | translate}} </p>
</div>

<div data-ng-switch-when="searchOptions">
<input type="checkbox"
id="{{key}}-checkbox"
data-ng-model="mCfg[key]"/>&nbsp;
<label class="control-label"
for="{{key}}-checkbox">{{('ui-' + key) | translate}}</label>

<p class="help-block"
data-ng-show="(('ui-' + key + '-help') | translate) != ('ui-' + key + '-help')">
{{('ui-' + key + '-help') | translate}} </p>
</div>

<div data-ng-switch-when="isSaveMapInCatalogAllowed">
<input type="checkbox"
id="{{key}}-checkbox"
Expand Down Expand Up @@ -669,6 +692,23 @@ <h3>{{('ui-' + key) | translate}}</h3>
{{('ui-' + key + '-help') | translate}} </p>
</div>

<div data-ng-switch-when="searchOptions">
<h3>{{('ui-' + key) | translate}}</h3>
<p class="help-block"
data-ng-show="(('ui-' + key + '-help') | translate) != ('ui-' + key + '-help')">
{{('ui-' + key + '-help') | translate}} </p>
<div data-ng-repeat="(t, value) in mCfg[key]">
<div>
<input type="checkbox"
id="{{key}}-{{t}}-checkbox"
data-ng-model="mCfg[key][t]"/>&nbsp;
<label for="{{key}}-{{t}}-checkbox">
{{(t) | translate}}
</label>
</div>
</div>
</div>

<div data-ng-switch-when="disabledTools">
<h3>{{('ui-' + key) | translate}}</h3>
<p class="help-block"
Expand Down
Loading

0 comments on commit 08024f4

Please sign in to comment.