Updated function score query to accept filter per function