#1341 remove config option

do not make partial search configurable
This commit is contained in:
Timotheus Kampik 2019-01-21 20:42:05 +01:00
parent b1c5915850
commit 2353253aa0
6 changed files with 4 additions and 12 deletions

View File

@ -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
----------

View File

@ -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

View File

@ -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,

View File

@ -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]),

View File

@ -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'}}
};

View File

@ -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})