Closed ovasquez closed 7 years ago
Two things:
lunr.js does stemming by default, so tabs is reduced to tab, which matches table in the Disqus integration section, just as an example. The question is if stemming makes sense here, but this is a general question.
The highlighting isn't ideal - sometimes the matching word is located later in the text. I would also like to see a summary here like on Google which highlights the matched words, but this gets complex very fast and probably isn't generalizable to all languages. I prototyped something that breaks of the sentence structure and tries to make a summary, but to no extent I think is robust enough. For this reason I decided to do it like this (for now). If you have a good idea or know a library that does summarization in a useful way, feel free to post.
The search functionality is a huge ongoing process. I think it's fairly good now, because the presentation of results is better and results provide more context than for example the readthedocs or mkdocs original theme search. However, I'm happy for input on making it even better.
I was unaware of the stemming, so that would make the results valid. I understand that showing the chunks of text where the match was found is not currently supported by lunr.js, so it makes sense as it currently is displaying it.
Thanks for the detailed explanation about the search.
If something better for summarization comes up, I'll definitely include it.
Description
Since the change in the search behavior to highlight the matching words I've noticed a couple of glitches the search:
##
headings in the search results for a document, even if the text is in just one section.The image below shows the search showing several
##
headings that don't contain "tabs" (neither in the displayed text or the content).The image below shows a document with no trace of the word "tabs" that is being listed in the search results
Expected behavior
The search should show only related subsections of related documents.
Actual behavior
Search shows all '##' headings for a document in the search results, and sometimes unrelated documents are shown.
Steps to reproduce the bug
Package versions