public static class NodeSearchRanking a node library against what somebody typed, and against the wire they dragged.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Ranked rather than filtered, and the two are different features. A menu that hid everything not matching makes an author who typed lerp and meant Mix find nothing; one that ranks shows the best guess first and the rest under it. Only a query that matches nothing at all produces nothing.
The score is a small integer with a stated ladder rather than a fuzzy distance, because what an author expects from a create menu is boring: an exact title first, then titles that start with what was typed, then titles that contain it, then the category, then the summary. A subsequence matcher — which the command palette does use, because a command is looked up by a phrase — puts Sample Texture 2D above Sample for the query st, which reads as a shuffle.
⚠ Ties break on the path, ordinally. Two node types that match equally well must come out in the same order every time or the item under the cursor moves between keystrokes that changed nothing.
Fields and properties (6)
public const int ExactThe score an exact title match gets.
public const int PrefixA title that starts with the query.
public const int WordPrefixA word of the title that starts with it.
public const int ContainsA title that contains it anywhere.
public const int CategoryA category that contains it.
public const int SummaryA summary that contains it.
Methods (2)
public static ImmutableArray<NodeSearchResult> Rank(NodeTypeRegistry registry, string? query, PortFilter? filter = null, int limit = 0)Ranks a library against a query.
public static string? Landing(NodeTypeDefinition definition, PortFilter filter)The first port of a type a dragged wire could land on.
Used by (2)
- NodeSearchPopupVixen.Editor.NodeGraph
- SearchTestsVixen.Editor.NodeGraph.Tests