Move logic of searchhistory into aura backend