microsoft / WinUI-Gallery

This app demonstrates the controls available in WinUI and the Fluent Design System.
MIT License
2.77k stars 624 forks source link

Full text search #394

Open MikeHillberg opened 4 years ago

MikeHillberg commented 4 years ago

The search feature only appears to search sample page names, not the page content. For example, to find sample code for FontIconSource, you have to know to search for SwipeControl.

It would be great to have an option to search the full text.

marcelwgn commented 4 years ago

This seems like a good idea, however I am not sure how we could implement this. After all, the search would need to be able to know the content of every page. What are your thoughts @stmoy?

Ideally, you wouldn't need to search for SwipeControl to find usage of FontIconSource but instead we would have a sample for it, though I am not entirely sure how that would work.

stmoy commented 4 years ago

From a product point of view, I think this is a totally righteous ask - I'd love to have a richer search experience. From a technical point of view, I'm also not sure how to implement this 😅

Also agree that we should probably have a sample for FontIconSource. Perhaps this sample could live alongside samples for the other icon types which are also not well represented.

ranjeshj commented 4 years ago

While searching all the content would be great that does make it a bit harder to achieve. A simpler task might be to add a list of search terms/tags to the json and match those in the search. That would atleast allow us to target specific results to show when searching. For example we can add search terms like StackLayout and UniformGridLayout to ItemsRepeater entry.

AndrewKeepCoding commented 4 months ago

Something like this should work for page content search & highlighting.

image RichTextBlockExtensions