Skip to content

Cannot search for certain words (e.g. "using") #10277

@CendioOssman

Description

@CendioOssman

Describe the bug

Certain words fail to produce any search results. One such word is "using", but there are likely more.

How to Reproduce

Include this simple document:

util
====

Synopsis
--------

**util** [*options*]

Description
-----------

**util** is great! See :ref:`index`.

Run this command using sudo
---------------------------

Will this be found by the search?

Generate some html, then search for "using".

Expected behavior

The page should be included in the search results.

Your project

N/A

Screenshots

No response

OS

Linux

Python version

3.6.12

Sphinx version

4.2.0

Sphinx extensions

No response

Extra tools

No response

Additional context

This is fallout from #2621. Which surprises me a bit since it is ages since that was committed. Perhaps something else hid the bug for so long?

The problem is that the JavaScript code assumes (in Search.query()) a word was left unstemmed if it is shorter than 3 characters. But that is not what SearchLanguage.word_filter() does as it has a much more complex logic. I also assume it can be overloaded for other languages than English.

Things work fine on Sphinx' own home page though for some reason. But it looks like it delegates the search to readthedocs rather than using the default search code.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions