Convert raw queries into query vector