Implemented prefix matching for last term of search string.