@@ -657,13 +657,13 @@ Set a custom search rank over pages matching a pattern.
657
657
:Type: ``map `` of patterns to ranks
658
658
:Default: ``{} ``
659
659
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:
663
663
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 ``.
667
667
668
668
The rank can be an integer number between -10 and 10 (inclusive).
669
669
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`.
685
685
# Match all files under the api/v1 directory
686
686
api/v1/* : -5
687
687
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
690
692
691
693
.. note ::
692
694
@@ -706,13 +708,13 @@ Paths matched will not be included in search results.
706
708
:Type: ``list `` of patterns
707
709
:Default: ``['search.html', 'search/index.html', '404.html', '404/index.html'] ``
708
710
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:
712
714
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 ``.
716
718
717
719
.. code-block :: yaml
718
720
@@ -726,7 +728,9 @@ Patterns can include some special characters:
726
728
# Ignore all files under the search/ directory
727
729
- search/*
728
730
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'
730
734
- ' */ref.html'
731
735
732
736
.. code-block :: yaml
0 commit comments