Skip to content

Commit 505ee4c

Browse files
authored
Docs: clarify search configuration patterns (#11076)
Closes #11060
1 parent d7f4c94 commit 505ee4c

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

docs/user/config-file/v2.rst

+19-15
Original file line numberDiff line numberDiff line change
@@ -657,13 +657,13 @@ Set a custom search rank over pages matching a pattern.
657657
:Type: ``map`` of patterns to ranks
658658
:Default: ``{}``
659659

660-
Patterns are matched against the final html pages produced by the build
661-
(you should try to match `index.html`, not `docs/index.rst`).
662-
Patterns can include some special characters:
660+
Patterns are matched against the relative paths of the HTML files produced by the build,
661+
you should try to match ``index.html``, not ``docs/index.rst``, nor ``/en/latest/index.html``.
662+
Patterns can include one or more of the following special characters:
663663

664-
- ``*`` matches everything
665-
- ``?`` matches any single character
666-
- ``[seq]`` matches any character in ``seq``
664+
- ``*`` matches everything, including slashes.
665+
- ``?`` matches any single character.
666+
- ``[seq]`` matches any character in ``seq``.
667667

668668
The rank can be an integer number between -10 and 10 (inclusive).
669669
Pages with a rank closer to -10 will appear further down the list of results,
@@ -685,8 +685,10 @@ check :ref:`config-file/v2:search.ignore`.
685685
# Match all files under the api/v1 directory
686686
api/v1/*: -5
687687
688-
# Match all files that end with tutorial.html
689-
'*/tutorial.html': 3
688+
# Match all files named guides.html,
689+
# two patterns are needed to match both the root and nested files.
690+
'guides.html': 3
691+
'*/guides.html': 3
690692
691693
.. note::
692694

@@ -706,13 +708,13 @@ Paths matched will not be included in search results.
706708
:Type: ``list`` of patterns
707709
:Default: ``['search.html', 'search/index.html', '404.html', '404/index.html']``
708710

709-
Patterns are matched against the relative path of html files produced by the build
710-
(you should try to match `index.html`, not `docs/index.rst`).
711-
Patterns can include some special characters:
711+
Patterns are matched against the relative paths of the HTML files produced by the build,
712+
you should try to match ``index.html``, not ``docs/index.rst``, nor ``/en/latest/index.html``.
713+
Patterns can include one or more of the following special characters:
712714

713-
- ``*`` matches everything
714-
- ``?`` matches any single character
715-
- ``[seq]`` matches any character in ``seq``
715+
- ``*`` matches everything (including slashes).
716+
- ``?`` matches any single character.
717+
- ``[seq]`` matches any character in ``seq``.
716718

717719
.. code-block:: yaml
718720
@@ -726,7 +728,9 @@ Patterns can include some special characters:
726728
# Ignore all files under the search/ directory
727729
- search/*
728730
729-
# Ignore all files named ref.html nested inside one or more sub-folders
731+
# Ignore all files named ref.html,
732+
# two patterns are needed to match both the root and nested files.
733+
- 'ref.html'
730734
- '*/ref.html'
731735
732736
.. code-block:: yaml

0 commit comments

Comments
 (0)