Skip to content

Commit 305ff5d

Browse files
authored
Merge pull request #3682 from camptocamp/doc_fts_similarity
Doc for gmf FTSearch's similarity
2 parents b521407 + b538f77 commit 305ff5d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

contribs/gmf/apps/desktop_alt/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
module.constant('langUrls', langUrls);
387387
module.constant('cacheVersion', cacheVersion);
388388
module.constant('authenticationBaseUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi');
389-
module.constant('fulltextsearchUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/fulltextsearch?limit=30&partitionlimit=5&interface=desktop');
389+
module.constant('fulltextsearchUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/fulltextsearch?limit=30&partitionlimit=5&interface=desktop&ranksystem=similarity');
390390
module.constant('gmfRasterUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/raster');
391391
module.constant('gmfPrintUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/printproxy');
392392
module.constant('gmfProfileJsonUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/profile.json');

contribs/gmf/src/directives/search.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ gmf.module.value('gmfSearchTemplateUrl',
6565
* <script>
6666
* (function() {
6767
* let module = angular.module('app');
68-
* module.value('fulltextsearchUrl', '${request.route_url('fulltextsearch', _query={"limit": 20}) | n}');
68+
* module.value('fulltextsearchUrl', '${request.route_url('fulltextsearch', _query={"limit": 20, "ranksystem": "similarity"}) | n}');
6969
* module.value('gmfSearchGroups', []);
7070
* module.constant('gmfSearchActions', [
7171
* {action: 'add_theme', title: 'Add a theme'},
@@ -95,6 +95,15 @@ gmf.module.value('gmfSearchTemplateUrl',
9595
* })();
9696
* </script>
9797
*
98+
* The 'fulltextsearchUrl' value in the examples above set three "_query" parameters: "limit",
99+
* "partitionlimit" and "ranksystem". For this last one "similarity" is the only effective value. It's used to
100+
* order your search results with the "similarity" ranking system from PostgreSQL module pg_trgm. Without this value,
101+
* the PostgreSQL function "ts_rank_cd" is used for the ranking. Read the full-text search c2cgeoportal documentation
102+
* to know more.
103+
* You can also add these parameters to the "url" variable of one (or more) of the
104+
* gmfx.SearchDirectiveDatasource given to this component (here within the "ctrl.searchDatasources"). That
105+
* allows you to have multiples configurations on one search component.
106+
*
98107
* @param {string} gmfSearchTemplateUrl URL to template.
99108
* @htmlAttribute {string} gmf-search-input-value The input value (read only).
100109
* @htmlAttribute {ol.Map} gmf-search-map The map.

0 commit comments

Comments
 (0)