The search function in the MSPbots app finds assets fast and efficiently using a flexible, intelligent search system that returns relevant results based on user keywords, even when the exact asset names are not used. It is available in the following sections of the app:
- Bots
- Dashboards
- Datasets
- KPIs
- Reports
- Scorecards
- Slicers
- Widgets
This document outlines how the MSPbots assets search function works, including its core components and optimization techniques.
MSPbots Assets Search Algorithm Workflow
The search function in the MSPbots app applies user-selected search options to return results. The default search option is Relevance, but users can change this setting according to their preference. The options are Name, Type, Status, Created Date, Creator, Last Modified, and Updater.
The MSPbots in-app search operates in the following key stages:
-
Input Processing
The search system performs the following actions on user queries to improve the accuracy of the results:- Keyword Mapping: Search uses a mapping dictionary to replace abbreviations and special characters with their full mapped terms.
- Syntax Checks: Malformed search queries are identified and corrected.
- Vector Generation: Search converts input text into vectors for similarity comparison.
- Metadata Search: The search is run across all metadata fields (e.g., names, descriptions, etc.) with full and partial case-insensitive matching. The keywords entered in the search box are matched against the asset's name and description fields.
- Typo Tolerance: Search supports auto-correction for up to two-letter typos and smart auto-suggestions with a one-letter typo tolerance.
-
Query Construction
A Boolean query is constructed to match identified conditions.- Data Type Matching: Returns results for specific datasets (i.e., template, custom, or both).
- Filter Conditions: Matches search criteria like Status, Widget type, Tags, Creator, and Modification dates.
- Creator, Time Range Matching: Considers Creator, Created date and Last Modified dates in filtering results.
-
Vector Matching and Custom Weighting
Search does the following to match queries to data and give weight to the results:- Similarity Calculation: Uses script queries to compute relevance scores based on Euclidean distance or cosine similarity.
- Weighted Ranking: Assigns different importance levels to attributes such as names, descriptions, and correction fields.
- Usage-Based Weighting: Increases relevance for frequently accessed resources.
Field Weight Name 10 Description 8 Correction Name 10 Correction Description 8 Fuzziness Name 7 Fuzziness Description 7 Name Vector Euclidean distance 3 Description Vector Euclidean distance 2 Document Widget 1
-
Scoring Model
Search calculates relevance based on the following scores:
-
Boolean Query Scores: Matches search criteria using logical operations.
-
Vector Similarity Scores: Computes relevance using the cosine similarity model.
-
Final Ranking: Combines all scores using a summation (SUM) model to rank results.
-
-
Search Result Logging
When a user searches for an asset, the front end triggers an API request and sends the sequence number of the accessed data, the search text, and the data ID to the backend for logging and analysis.