From 1508d305b8e3d8de8e918f595e1b7973e06d19fe Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Fri, 15 Mar 2024 12:36:56 +1300 Subject: [PATCH] Desktop: Add Country to the Fields Indexed for Fulltext Search. Add 'Country' to the fields that are indexed for fulltext search - this seems to be a quite intuitive choice as 'Country' is also a field that is available in the dive list view. Fixes #4134. Signed-off-by: Michael Keller --- CHANGELOG.md | 1 + core/fulltext.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6379cc49..33a1eca28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +desktop: add country to the fields indexed for full text search import: update libdivecomputer version, add support for the Scubapro G3 / Luna and Shearwater Tern desktop: add a button linking to the 'Contribute' page mobile: fix configuration of decompression ceiling and gradient factors diff --git a/core/fulltext.cpp b/core/fulltext.cpp index dccdba0b0..09af5b7ac 100644 --- a/core/fulltext.cpp +++ b/core/fulltext.cpp @@ -139,8 +139,12 @@ static std::vector getWords(const dive *d) } // TODO: We should tokenize all dive-sites and trips first and then // take the tokens from a cache. - if (d->dive_site) + if (d->dive_site) { tokenize(d->dive_site->name, res); + const char *country = taxonomy_get_country(&d->dive_site->taxonomy); + if (country) + tokenize(country, res); + } // TODO: We should index trips separately! if (d->divetrip) tokenize(d->divetrip->location, res);