build sql instead of query directly for keywords import