Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jayaddison opened this issue Mar 1, 2024 · 2 comments

Comments

@jayaddison
Copy link
Contributor

jayaddison commented Mar 1, 2024

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.

@wlach
Copy link
Contributor

wlach commented Mar 1, 2024

I'm pretty sure the code as originally written (before this PR is applied) does reflect how the search index behaves, see: #11958 (comment)

@jayaddison
Copy link
Contributor Author

Great catch, thank you. This is indeed invalid (as is the linked PR).

@jayaddison jayaddison closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants