Fixed issue where search would return incorrect results if a query term
appeared in multiple positions for a match