[SalesForce] lightning global search url

Is there a readable URL for global search in Lightning, similar to Classic that use &startURL=/_ui/search/ui/UnifiedSearchResults?str=valueToSearch ?.

I want to use this URL to add to Chrome omnibar so that the reps can easily search a record in salesforce. But the lightning URL is encoded and I am not able to figure out what should url should I add to the search engine.

Best Answer

This code works in lightning

var searchQuery = 'test@test.com';
var stringToEncode = '{"componentDef":"forceSearch:search","attributes":{"term":"'+searchQuery + '","scopeMap":{"type":"TOP_RESULTS"},"context": {"disableSpellCorrection":false,"SEARCH_ACTIVITY":{"term":"'+ searchQuery + '"}}}}';
var encodedString = btoa(stringToEncode);

var globalSearchUrl ="/one/one.app?source=alohaHeader#" +encodedString

pass this url to window.open or use it in workspaceAPI.openTab