Skip to content

Test suite: search: test fixture does not accurately represent the JS search index format #12028

@jayaddison

Description

@jayaddison

Describe the bug

I think that this test index fixture in the JavaScript test suite does not accurately represent the way that the Sphinx search index is structured.

In particular, I think that the terms entry within the index is a mapping from a set of strings (the keys) to a list (or Array) of document-ids; not to a single document-id as currently configured.

This means that the test is not exercising the JS search behaviour as intended.

How to Reproduce

While browsing a locally-hosted copy of the Sphinx self-built documentation, inspect the content of Search._index.terms in the browser's JavaScript console:

>> Search._index.terms["sphinx"]
Array(50) [ 1, 2, 4, 6, 7, 8, 9, 11, 12, 15, … ]

Environment Information

Platform:              linux; (Linux-6.6.15-rt-amd64-x86_64-with-glibc2.37)
Python version:        3.11.8 (main, Feb  7 2024, 21:52:08) [GCC 13.2.0])
Python implementation: CPython
Sphinx version:        7.3.0+/a897b4884
Docutils version:      0.20.1
Jinja2 version:        3.1.3
Pygments version:      2.17.2

Sphinx extensions

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
              'sphinx.ext.autosummary', 'sphinx.ext.extlinks',
              'sphinx.ext.intersphinx',
              'sphinx.ext.viewcode', 'sphinx.ext.inheritance_diagram',
              'sphinx.ext.coverage']

Additional context

May invalidate #11958.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions