fix: exclude redundant search results #107
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Testing
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".