Search functionality on WPF, WinUI, Maui is shared - #1830
Conversation
| @@ -0,0 +1,36 @@ | |||
| using ArcGIS.Samples.Shared.Models; | |||
There was a problem hiding this comment.
This file is not new code, it just got moved from inside SearchViewModel
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
This was moved to a new file
| /// Initializes a new instance of the <see cref="SearchManager"/> class with the provided list of samples. | ||
| /// </summary> | ||
| /// <param name="samples">The list of samples to be managed by the search engine.</param> | ||
| public SearchEngine(IList<SampleInfo> samples) |
There was a problem hiding this comment.
Most of the code in this file was moved from Maui search implementation, the changes happened under the SearchEngine constructor and Search method. Extra focus on those methods would cover 90% of the changes.
There was a problem hiding this comment.
In the previous version of the WPF/WinUI, searching for "Display local scene" returned the expected sample as the top result.
After these changes, the same query returns a large number of results with the intended sample buried near the bottom of the list.
The same search query on MAUI shows the intended sample as the top result.
|
In reply to this 👆 comment. This issue concerns how search results are presented in .NET MAUI compared to WinUI/WPF applications. Current behavior:
The search implementation is now shared across all platforms and provides a match score for each result. However, because WinUI/WPF presents results in a hierarchical tree structure, it is not straightforward to surface the highest scoring matches at the top without modifying the existing UI. Possible Approaches
DiscussionThe primary consideration is whether consistency of result ranking across platforms is more important than preserving the existing categorized navigation experience on WinUI/WPF. The flat list approach provides the most consistent ranking experience with MAUI, while the Top Results approach attempts to balance relevance-based ranking with the existing grouped presentation model. |
|
Opting for "Display results in a flat list for WinUI/WPF" would also fix this issue. |
imalcolm1
left a comment
There was a problem hiding this comment.
Looks good, thanks a bunch for implementing this!


Description
To improve the search functionality on WPF and WinUI we abstracted the Maui search functionality to be shared between all projects. Previously, a search "dynamic gallery" would attempt to match the full string into a name or description and return no results. This PR fixes that.
Type of change
Changes are visible on WPF and WinUI, although underlying changes apply to all projects.
Implementation:
SearchEngineclass in the Shared project.Platforms tested on
Checklist