Area: UI Issues
Sub-Area: Search and Filtering
Issue
Search functionality in the DataHub settings UI for policies and roles may not behave as expected when using short search terms or partial matches. Users may find that certain search queries return incomplete results or fail to match expected items, particularly when searching for substring matches within longer role or policy names.
You Might Be Asking
- Why doesn't searching for "NP" return results containing "TEAM_NP_ROLE"?
- Why do some partial searches work while others don't?
- How can I search for exact substrings in policy and role names?
Solution
- Minimum Character Requirement: Ensure you enter at least 3 characters for search queries. Searches with fewer than 3 characters may not return expected results due to infrastructure limitations.
- Understanding Default Search Behavior: When you search for terms like "TEAM_NP", DataHub performs an OR search for "TEAM" OR "NP". This is why you might see broader results than expected.
-
Use Exact Substring Matching: To search for exact substrings, wrap your search term in double quotes:
This will match only items containing the exact phrase "TEAM_NP" rather than performing an OR search."TEAM_NP" -
Alternative Search Strategies:
- Use longer, more specific search terms when possible
- Search for unique parts of the name that are likely to be standalone tokens
- Use the exact phrase search with quotes for precise matching
Additional Notes
This behavior is due to how DataHub's search algorithm tokenizes and matches search terms. Short queries may not match substrings within longer tokens unless the field is indexed as a keyword or supports ngram/prefix matching. The current search configuration prioritizes performance and broad matching over substring searches for very short terms. This is not a defect but a design limitation of the current Elasticsearch tokenization configuration.
Related Documentation
Tags: search, settings, ui, policies, roles, partial-match, elasticsearch, tokenization, quotes, substring