Skip to content

Commit

Permalink
Merge pull request #3682 from camptocamp/doc_fts_similarity
Browse files Browse the repository at this point in the history
Doc for gmf FTSearch's similarity
  • Loading branch information
ger-benjamin committed Mar 21, 2018
2 parents b521407 + b538f77 commit 305ff5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop_alt/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
module.constant('langUrls', langUrls);
module.constant('cacheVersion', cacheVersion);
module.constant('authenticationBaseUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi');
module.constant('fulltextsearchUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/fulltextsearch?limit=30&partitionlimit=5&interface=desktop');
module.constant('fulltextsearchUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/fulltextsearch?limit=30&partitionlimit=5&interface=desktop&ranksystem=similarity');
module.constant('gmfRasterUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/raster');
module.constant('gmfPrintUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/printproxy');
module.constant('gmfProfileJsonUrl', 'https://geomapfish-demo.camptocamp.net/2.2/wsgi/profile.json');
Expand Down
11 changes: 10 additions & 1 deletion contribs/gmf/src/directives/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ gmf.module.value('gmfSearchTemplateUrl',
* <script>
* (function() {
* let module = angular.module('app');
* module.value('fulltextsearchUrl', '${request.route_url('fulltextsearch', _query={"limit": 20}) | n}');
* module.value('fulltextsearchUrl', '${request.route_url('fulltextsearch', _query={"limit": 20, "ranksystem": "similarity"}) | n}');
* module.value('gmfSearchGroups', []);
* module.constant('gmfSearchActions', [
* {action: 'add_theme', title: 'Add a theme'},
Expand Down Expand Up @@ -95,6 +95,15 @@ gmf.module.value('gmfSearchTemplateUrl',
* })();
* </script>
*
* The 'fulltextsearchUrl' value in the examples above set three "_query" parameters: "limit",
* "partitionlimit" and "ranksystem". For this last one "similarity" is the only effective value. It's used to
* order your search results with the "similarity" ranking system from PostgreSQL module pg_trgm. Without this value,
* the PostgreSQL function "ts_rank_cd" is used for the ranking. Read the full-text search c2cgeoportal documentation
* to know more.
* You can also add these parameters to the "url" variable of one (or more) of the
* gmfx.SearchDirectiveDatasource given to this component (here within the "ctrl.searchDatasources"). That
* allows you to have multiples configurations on one search component.
*
* @param {string} gmfSearchTemplateUrl URL to template.
* @htmlAttribute {string} gmf-search-input-value The input value (read only).
* @htmlAttribute {ol.Map} gmf-search-map The map.
Expand Down

0 comments on commit 305ff5d

Please sign in to comment.