get query term from config or option