diff --git a/CHANGES b/CHANGES index 9274dc16d..57c9bb543 100644 --- a/CHANGES +++ b/CHANGES @@ -159,6 +159,8 @@ Features added * #5841: apidoc: Add --extensions option to sphinx-apidoc * #4981: C++, added an alias directive for inserting lists of declarations, that references existing declarations (e.g., for making a synopsis). +* #1341 the HTML search considers words that contain a search term of length + three or longer a match. Bugs fixed ---------- diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index 2e9fb1880..8b82147c1 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -1300,13 +1300,6 @@ that use Sphinx's HTMLWriter class. * ``dict`` -- the ``jieba`` dictionary path if want to use custom dictionary. -.. confval:: html_search_partial_matching - - If true, the HTML search will consider words that contain a search term of - length three or longer a match. Default: ``True``. - - .. versionadded:: 2.0 - .. confval:: html_search_scorer The name of a JavaScript file (relative to the configuration directory) that diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index e93f55cba..b12929e8e 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -549,7 +549,6 @@ class StandaloneHTMLBuilder(Builder): 'show_copyright': self.config.html_show_copyright, 'show_sphinx': self.config.html_show_sphinx, 'has_source': self.config.html_copy_source, - 'search_partial_matching': self.config.html_search_partial_matching, 'show_source': self.config.html_show_sourcelink, 'sourcelink_suffix': self.config.html_sourcelink_suffix, 'file_suffix': self.out_suffix, diff --git a/sphinx/config.py b/sphinx/config.py index 2292d2350..e4087385f 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -141,7 +141,6 @@ class Config: 'numfig': (False, 'env', []), 'numfig_secnum_depth': (1, 'env', []), 'numfig_format': ({}, 'env', []), # will be initialized in init_numfig_format() - 'html_search_partial_matching': (True, 'html', []), 'math_number_all': (False, 'env', []), 'math_eqref_format': (None, 'env', [str]), diff --git a/sphinx/themes/basic/static/documentation_options.js_t b/sphinx/themes/basic/static/documentation_options.js_t index 881918442..66d4bab88 100644 --- a/sphinx/themes/basic/static/documentation_options.js_t +++ b/sphinx/themes/basic/static/documentation_options.js_t @@ -6,6 +6,5 @@ var DOCUMENTATION_OPTIONS = { FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}', HAS_SOURCE: {{ has_source|lower }}, SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}', - NAVIGATION_WITH_KEYS: {{ 'true' if theme_navigation_with_keys|tobool else 'false'}}, - PARTIAL_SEARCH_MATCHING: {{ 'true' if search_partial_matching|tobool else 'false'}} + NAVIGATION_WITH_KEYS: {{ 'true' if theme_navigation_with_keys|tobool else 'false'}} }; diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js index c16c11487..f62de7b7c 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -392,7 +392,7 @@ var Search = { {files: titleterms[word], score: Scorer.title} ]; // add support for partial matches - if (DOCUMENTATION_OPTIONS.PARTIAL_SEARCH_MATCHING && word.length > 2) { + if (word.length > 2) { for (var w in terms) { if (w.match(word)) { _o.push({files: terms[w], score: Scorer.partialTerm})