Advanced search functionality for UTCP tools and providers.
Provides multiple search algorithms including:
- Exact matching
- Fuzzy search with similarity scoring
- Semantic search based on descriptions
- Tag-based filtering
- Provider-based filtering
- Transport-based filtering
Summary
Functions
Gets search suggestions based on partial query.
Creates a new search engine with default configuration.
Searches for providers using the specified query and options.
Searches for tools using the specified query and options.
Suggests similar tools based on a given tool.
Types
@type search_options() :: %{ algorithm: :exact | :fuzzy | :semantic | :combined, filters: %{providers: [String.t()], transports: [atom()], tags: [String.t()]}, limit: integer(), threshold: float(), include_descriptions: boolean(), use_haystack: boolean(), security_scan: boolean(), filter_sensitive: boolean() }
@type search_result() :: %{ tool: ExUtcp.Types.tool(), score: float(), match_type: :exact | :fuzzy | :semantic, matched_fields: [String.t()], security_warnings: [map()] }
Functions
@spec get_suggestions(ExUtcp.Search.Engine.t(), String.t(), keyword()) :: [String.t()]
Gets search suggestions based on partial query.
@spec new(keyword()) :: ExUtcp.Search.Engine.t()
Creates a new search engine with default configuration.
@spec search_providers(ExUtcp.Search.Engine.t(), String.t()) :: [map()]
Searches for providers using the specified query and options.
@spec search_providers(ExUtcp.Search.Engine.t(), String.t(), map()) :: [map()]
@spec search_tools(ExUtcp.Search.Engine.t(), String.t()) :: [search_result()]
Searches for tools using the specified query and options.
@spec search_tools(ExUtcp.Search.Engine.t(), String.t(), map()) :: [search_result()]
@spec suggest_similar_tools(ExUtcp.Search.Engine.t(), ExUtcp.Types.tool(), keyword()) :: [ search_result() ]
Suggests similar tools based on a given tool.