Package net.storm.api.plugins.config
Class PluginSearch
java.lang.Object
net.storm.api.plugins.config.PluginSearch
Utility class for searching and filtering plugins based on query strings.
PluginSearch provides fuzzy search functionality for the plugin list, matching plugins based on their names, keywords, and tags. Results are sorted by relevance, with exact matches and pinned plugins ranked higher.
Search algorithm:
- Filters plugins that match any search term in their keywords
- Sorts by pinned status (pinned first)
- Ranks exact name matches higher
- Ranks partial name matches (prefix and contains)
- Considers install count for popularity ranking
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends SearchablePlugin>
List<T> search(Collection<T> searchablePlugins, String query) Searches a collection of plugins for matches to the given query.
-
Constructor Details
-
PluginSearch
public PluginSearch()
-
-
Method Details
-
search
public static <T extends SearchablePlugin> List<T> search(Collection<T> searchablePlugins, String query) Searches a collection of plugins for matches to the given query.- Type Parameters:
T- the type of searchable plugin- Parameters:
searchablePlugins- the collection of plugins to searchquery- the search query string- Returns:
- a list of matching plugins, sorted by relevance
-