-
Notifications
You must be signed in to change notification settings - Fork 875
feat!: search improvements #10113
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
feat!: search improvements #10113
Conversation
|
Hello |
|
I'm done on my side (with some minor tweaks that could be done, see TODO). I will push a merge against current |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10113 +/- ##
==========================================
+ Coverage 74.31% 79.36% +5.04%
==========================================
Files 536 548 +12
Lines 23189 23686 +497
Branches 4056 4079 +23
==========================================
+ Hits 17234 18799 +1565
+ Misses 4853 3713 -1140
- Partials 1102 1174 +72 ☔ View full report in Codecov by Sentry. |
|
@yufeih any input on this? Is there anything else you'd like me to handle for this to get looked at / approved? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @frarees
|
@frarees After updating docfx with the PR and generating a new version of my documentation, the search feature is no more working! I have the following error in browser console: Do you have an error about what's wrong? |
|
@Patrick8639 can you set global metadata |
|
@frarees It works better, as I now have results. Note that it would be great to have a default of Also, is there documentation about this property? |
|
@Patrick8639 I've tried locally using a development version (cloned repo) as well as the last release version (v2.78.3), with the provided sample project (seed/docfx.json, which has Are you using default theme or modern? Let me know if you have further repro details I could use.
That'd be ideal, although I left it opt-in to not break behaviour on current setups. In the future this might change.
I don't think so, I can add the lines to the repo so next time the site is built they will be documented. Oversight on my side.
Yes, the search engine setup could use further refinement to find words. Was it working before for this specific case, and is not after upgrade? |
|
I'm also encountered issues on my environment. |
I thought about it and tried: it doesn't work in my case. |
|
@frarees
Customized modern theme. This customization is about how the classes and members are displayed.
I can give you the assemblies and all the files needed to compile the help file, including the custom template.
No, it wasn't working before, but I thought it will be after upgrade. |
The way the search engine works is tricky. The main advantage I wanted to bring with the update is the ability to split words so that YouCanSearchThroughYourMembers more easily (here 'search members' would yield useful results for you). When it comes to incomplete words, the engine does algorithm-based stemming. But we need a bit more than than to make things work. This is possibly not known (as in, I don't remember DocFX having this documented), but the search can use a variety of modifiers. Of special interest:
Specially important if you have a custom
Sure, you could create your own repo (or a branch if your project is already open?) and share a link here, and I'll take a look. |
I will take a look later and send you something. |
Where is this documented? Personally, I think the search engine would be more user friendly if it didn't have to use special modifiers on queries. If I search for a method in my codebase, I want to be able to find it without having to remember exactly how it is spelled...and even then, I only get results usually based on namespaces and classes first instead of my method... Are there any recommendations for how I could improve the search-ability? |
Part of Lunr documentation, not documented officially on DocFX or the default or modern themes themselves afaik https://lunrjs.com/guides/searching.html
Absolutely. The theme is not offering this yet.
What I did for this PR is help split API members in words. Which improves searchability but it doesn't solve the problem completely. Reading through Lunr documentation might give you ideas on how the theme could be improved to benefit from the features without having to manually specify the modifiers. |
|
Hi @frarees , how do you make a new I'm wondering because I'm trying to change a few things in the search feature, but want to test it out in my browser first, do you know how I can do that? |
|
@frarees nvm, figured it out 😎 |
|
Also wishing you well in coherence (looks pretty cool) |
It would be nice if you give the information for others... |
Motivation
DocFX's current state of the search functionality has some flaws:
ManagedReferenceExampleand I search forManagedI will get no results. Same goes forManagedReferenceWhat has changed
_searchIndexUseMetadataand_searchIndexUseMetadataTitleto opt-inFillMetadataTitleandSummaryinManifestPropertiessummarySearchIndexItem.Keywordsholds different content for MREFsManagedReferenceExample->Managed ManagedReference ManagedReferenceExample ManagedExample Reference ReferenceExample ExampleKeywordsis still present and it's used to store exclusively for keywords, and processed by the search engineSummaryis rendered by the themes (brief)Notes / TODO