Skip to content

Search ranking seemingly has no effect #11060

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

Closed
astrojuanlu opened this issue Jan 24, 2024 · 7 comments · Fixed by #11076
Closed

Search ranking seemingly has no effect #11060

astrojuanlu opened this issue Jan 24, 2024 · 7 comments · Fixed by #11076
Labels
Needed: documentation Documentation is required Support Support question

Comments

@astrojuanlu
Copy link
Contributor

Details

Expected Result

In kedro-org/kedro#3546 we added this to .readthedocs.yml:

search:
  ranking:
    # Match API docs (files prefixed "kedro.") and push them down the ranking
    '*/kedro.*.html': -5

with the intention of having narrative docs show above API pages for search.

Actual Result

We still see API results on top.

See for example searching for "node":

image

in https://docs.kedro.org/en/latest/

  • Should we have marked this as -10 to drop it right down?
  • Should we also boost the narrative docs up?
  • Should we even expect to see results right now, or is the indexing done separately to the HTML build? How can I force a new index?

cc @stichbury

@humitos
Copy link
Member

humitos commented Jan 24, 2024

    '*/kedro.*.html': -5

This particular case that uses two * called my attention and I went to the docs to check if it's possible. At first sight, it doesn't say it's not allowed and I understand that's valid (https://docs.readthedocs.io/en/stable/config-file/v2.html#search-ranking)

I think you did everything correctly and it should work as expected. The build for latest version already includes the search.ranking configuration properly (https://beta.readthedocs.org/projects/kedro/builds/23208343/), which tells the search engine to create the index with that particular ranking at build time.

I'd say there are two alternatives here:

  1. we are interpreting the docs incorrectly and multiple * are not allowed
  2. there is a bug when creating the search index

cc @stsewd do you know what's happening here?

@stsewd
Copy link
Member

stsewd commented Jan 24, 2024

Hi, the file you are trying to match is kedro.framework.hooks.specs.DatasetSpecs.html? We do the match over the path starting from the root, so */ is trying to match a directory first, but that file is at the root, so it doesn't match. The pattern you need is kedro.*.html, if you have more files like that in subdirectories, then */kedro.*.html is also needed.

@stsewd
Copy link
Member

stsewd commented Jan 24, 2024

We should probably update this example to make it more explicit about matching subdirectories only.

https://docs.readthedocs.io/en/stable/config-file/v2.html#search-ranking

    # Match all files that end with tutorial.html
    '*/tutorial.html': 3

@astrojuanlu
Copy link
Contributor Author

Thanks for your answers! We're moving some docs around to make it easier and will give this another go.

If we put our API docs under /api, would api/*: -5 be a good rule?

@stichbury
Copy link

Indeed, thanks for your help! Just to clarify, I put the ranking down to -5 rather than -10 because I didn't want to hide the docs behind everything else that matches the search term, but wanted to force the markdown "narrative" docs in front (on the whole) where they're a better match. Does that sound about right?

@stsewd
Copy link
Member

stsewd commented Jan 25, 2024

If we put our API docs under /api, would api/*: -5 be a good rule?

Yes

Indeed, thanks for your help! Just to clarify, I put the ranking down to -5 rather than -10 because I didn't want to hide the docs behind everything else that matches the search term, but wanted to force the markdown "narrative" docs in front (on the whole) where they're a better match. Does that sound about right?

yes

@humitos humitos added the Needed: documentation Documentation is required label Jan 25, 2024
stsewd added a commit that referenced this issue Jan 29, 2024
stsewd added a commit that referenced this issue Jan 29, 2024
stsewd added a commit that referenced this issue Jan 29, 2024
@astrojuanlu
Copy link
Contributor Author

FTR, we made the changes we described and things seem to be working now, thanks for the support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: documentation Documentation is required Support Support question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants