DocFX's current state of the search functionality has some flaws:
Searching through APIs can yield no results unless you type the complete symbol name
For example, if I have a page ManagedReferenceExample and I search for Managed I will get no results. Same goes for ManagedReference
This is specially important for API pages, since one of the reasons users want to use the search functionality is because they've forgotten the full name of a member
Searching multiple terms doesn't narrow the search, but the opposite
When I finish inputting my search query, I press Enter instinctively, which clears the search and reloads the page
What has changed
New global metadata keys _searchIndexUseMetadata and _searchIndexUseMetadataTitle to opt-in
New build step for MREFs: FillMetadata
Stores Title and Summary in ManifestProperties
Search Index
Includes new property summary
Entries for MREFs can be loaded from metadata instead of HTML scrapping
SearchIndexItem.Keywords holds different content for MREFs
Parses through the symbol's full name and creates permutations of the words found
ManagedReferenceExample -> Managed ManagedReference ManagedReferenceExample ManagedExample Reference ReferenceExample Example
Keywords is still present and it's used to store exclusively for keywords, and processed by the search engine
Summary is rendered by the themes (brief)
Modern theme
Don't allow Enter/Submit on search
Search is additive: searching multiple terms uses AND instead of OR
Notes / TODO
The regex used to create keywords, while accounting for most cases, is not perfect
Default theme could use similar changes to modern theme, so UX is similar
Motivation
DocFX's current state of the search functionality has some flaws:
ManagedReferenceExample
and I search forManaged
I will get no results. Same goes forManagedReference
What has changed
_searchIndexUseMetadata
and_searchIndexUseMetadataTitle
to opt-inFillMetadata
Title
andSummary
inManifestProperties
summary
SearchIndexItem.Keywords
holds different content for MREFsManagedReferenceExample
->Managed ManagedReference ManagedReferenceExample ManagedExample Reference ReferenceExample Example
Keywords
is still present and it's used to store exclusively for keywords, and processed by the search engineSummary
is rendered by the themes (brief)Notes / TODO