summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Jörns <ejo@pengutronix.de>2025-07-03 12:23:01 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-04 22:48:21 +0100
commitb1acce19554396b5127baf48fa182a381f6a6710 (patch)
tree8f07f1e6ed8146c76db4060838fa152c02d7ea0e
parenteab29e5b541434724261aa390305ba856c5b5943 (diff)
downloadpoky-b1acce19554396b5127baf48fa182a381f6a6710.tar.gz
conf.py: improve SearchEnglish to handle terms with dots
While search queries already handled words with hyphens correctly, they did not do so for words with dots. To fix this, we - enhance the word tokenizer to treat both dots ('.') and hyphens ('-') as valid characters within words. (For robustness, explicitly exclude dots/hyphens at the start or end of a word from indexing.) - adjust query processing to avoid splitting on dots in search input This allows search queries to correctly match terms such as 'local.conf', 'site.conf', and similar ones now. Fixes: [YOCTO #14534] (From yocto-docs rev: 80084a4cabdf7f61c7e93eda8ddbd5bc7d54e041) Signed-off-by: Enrico Jörns <ejo@pengutronix.de> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--documentation/conf.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/documentation/conf.py b/documentation/conf.py
index 1eca8756ab..c07b6c4199 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -179,13 +179,13 @@ from sphinx.search import SearchEnglish
179from sphinx.search import languages 179from sphinx.search import languages
180class DashFriendlySearchEnglish(SearchEnglish): 180class DashFriendlySearchEnglish(SearchEnglish):
181 181
182 # Accept words that can include hyphens 182 # Accept words that can include 'inner' hyphens or dots
183 _word_re = re.compile(r'[\w\-]+') 183 _word_re = re.compile(r'[\w]+(?:[\.\-][\w]+)*')
184 184
185 js_splitter_code = r""" 185 js_splitter_code = r"""
186function splitQuery(query) { 186function splitQuery(query) {
187 return query 187 return query
188 .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu) 188 .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}\-\.]+/gu)
189 .filter(term => term.length > 0); 189 .filter(term => term.length > 0);
190} 190}
191""" 191"""