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

fix: exclude redundant search results #107

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

wesleyboar
Copy link
Collaborator

@wesleyboar wesleyboar commented Dec 17, 2024

Overview

Exclude redundant items from search.

Problem This Change Solves

Search normally shows results for content from all pages. But this repo includes pages (via include-markdown) into other pages. So when user searches "A", which is on page "X", which is included on page "Y"; then search results show page "X" and page "Y". In this repository, page "X" is usually not in the navigation, while page "Y" is. So, visiting page "X" from search results shows a page with no relevant navigation revealed.

How This Change Solves It

This change excludes all content from search that are on pages that are not directly included by navigation i.e. it excludes and pages included via include-markdown e.g. page "X" (an example described in "Problem This Change Solves").

Related

Changed

  • added a setting

Testing

  1. Search for a phrase that is in the docs on a page that is included in another page.
  2. See zero duplicate results.

UI

Before.Exclude.mov

The repeat headings in the results also have the same context; notice the smaller text underneath each duplicate heading.

After.Exclude.mov

The two "Description" results shown are from different context; notice the smaller text underneath each "Description".

@wesleyboar wesleyboar merged commit cf78804 into main Dec 17, 2024
@wesleyboar wesleyboar deleted the fix/exclude-redundant-items-from-search branch December 17, 2024 16:36
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.

1 participant