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

Use the index directive as a source for search #6692

Closed
JulienPalard opened this issue Sep 9, 2019 · 6 comments · Fixed by #10819
Closed

Use the index directive as a source for search #6692

JulienPalard opened this issue Sep 9, 2019 · 6 comments · Fixed by #10819
Assignees
Labels
html search type:enhancement enhance or introduce a new feature
Milestone

Comments

@JulienPalard
Copy link
Contributor

Is your feature request related to a problem? Please describe.

My problem is the search engine is not good at finding terms that are indexed, for example:

Describe the solution you'd like
I think using the global index as a source for the search engine is a good way to enhance this and allow people to manually boost a search result by using the bang of the index directive. (.. index:: ! Python).

I can try to implement it, but I'm still not sure this is a good idea.

Generated Index can point to anchors, I'm not sure the current searchindex can hold them in its current state.

@ammaraskar
Copy link

A non-python example, searching for ciphertext in pyca/cryptography, the glossary ciphertext term is pretty low on the page and hidden among mentions of it within autodoc pages.

@tk0miya tk0miya added this to the 3.3.0 milestone Jul 22, 2020
@tk0miya tk0miya modified the milestones: 3.3.0, 4.0.0 Oct 4, 2020
@xmo-odoo
Copy link
Contributor

xmo-odoo commented Dec 8, 2020

There's also a bpo issue on that subject: https://bugs.python.org/issue42106

It provides more examples from the Python documentation

For instance if you search "append": https://docs.python.org/3/search.html?q=append

On my end, neither list nor MutableSequence appear anywhere on this page, even scrolling down.

Searching for "list": https://docs.python.org/3/search.html?q=list

The documentation for the builtin "list" object also doesn't appear on the page. Data Structures and built-in types appear below the fold and the former is genuinely useful but also very easy to miss (I had not actually noticed it before going back in order to get the various links and try to extensively describe the issue). Neither actually links to the list builtin type though.

Above the fold we find various "list" methods and classes from the stdlib as well as the PDB list comment, none of which seems like the best match for the query.

@tk0miya tk0miya modified the milestones: 4.0.0, 4.1.0 Mar 25, 2021
@tk0miya tk0miya modified the milestones: 4.1.0, 4.2.0 Jul 10, 2021
@tk0miya tk0miya modified the milestones: 4.2.0, 4.3.0 Sep 12, 2021
@tk0miya tk0miya modified the milestones: 4.3.0, 4.4.0 Nov 8, 2021
@tk0miya tk0miya modified the milestones: 4.4.0, 5.0.0 Jan 15, 2022
@tk0miya tk0miya modified the milestones: 5.0.0, 5.x May 2, 2022
@AA-Turner AA-Turner modified the milestones: 5.x, some future version May 23, 2022
@AA-Turner AA-Turner self-assigned this Aug 2, 2022
@AA-Turner AA-Turner modified the milestones: some future version, 5.2.0 Aug 2, 2022
@AA-Turner
Copy link
Member

This would also be useful for the core CPython documentation.

A

@CAM-Gerlach
Copy link
Contributor

Yeah, as discussed, this would be extremely useful for the CPython docs, as brought up in python/cpython#60075 , python/cpython#89541 , python/cpython#86272, python/cpython#86272 and probably others, so it would be fantastic if you could implement this. To be honest, it confuses me why the search index wouldn't include the...index...to begin with, heh.

I was going to offer to help, but I'm sure you'd do a far better job than I would. If you do need something within my (limited) skillset, like testing this or reviewing docs, etc, let me know. Thanks!

@AA-Turner AA-Turner changed the title Use the index directive as a source for search. Use the index directive as a source for search Sep 12, 2022
@AA-Turner
Copy link
Member

A draft implementation is at #10819. This issue suggests using the genindex source directly, whilst that is possible it ties to the builder a little too much for my liking.

A

@AA-Turner
Copy link
Member

Testing of the PR would be appreciated!

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
html search type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants