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

Include path in the search index with include_path #1509

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

timakro
Copy link
Contributor

@timakro timakro commented May 31, 2021

This way URLs can be searched conveniently on wiki- / knowledge base- / docs-style sites. E.g. the path /documentation/getting-started/overview/ at https://getzola.org would be matched by queries like "documentation" or "getting started".

Closes #1481.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

@Keats
Copy link
Collaborator

Keats commented Jun 1, 2021

the path /documentation/getting-started/overview/ at https://getzola.org would be matched by queries like "documentation" or "getting started".

Does that mean that the index will be essentially filled with "useless" data in this case? Every doc page starts with documentation

@timakro
Copy link
Contributor Author

timakro commented Jun 1, 2021

On my wiki I have a bunch of pages in the hack section. All of them are indexed under "hack":

image

So when you search for "hack" you find those pages. To me this seems like the behavior you'd expect.

You probably only want to use path search when the path of the pages is exposed to your users in some way. For example if you show the path of the pages in the search results and highlight the matches. Or if you show the path on top of the page e.g. in breadcrumbs style. Then matching all docs pages when searching for "documentation" makes sense.

image

@Keats Keats merged commit 16c123a into getzola:next Jun 2, 2021
@timakro
Copy link
Contributor Author

timakro commented Jun 2, 2021

Thanks for taking the time to review my code. And thanks for creating this terrific piece of software! :)

@Keats
Copy link
Collaborator

Keats commented Jun 2, 2021

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants