Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can an RST file be excluded from Sphinx's default search?

In a Sphinx project written using RST, is there a way to exclude a file from consideration by the default search functionality? Some of the RST files in the project are included as reference (such as LICENSE files), but are not useful in the search results.

Is there a configuration option or directive that instructs Sphinx not to index a particular RST file for inclusion in the search results?

like image 596
phoenix Avatar asked Oct 18 '25 06:10

phoenix


1 Answers

If you add :nosearch: at the top of the RST file, it will be excluded from the full text search.

This feature was added in Sphinx 3.0. See https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#special-metadata-fields.

like image 131
mzjn Avatar answered Oct 19 '25 22:10

mzjn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!