modified elasticsearch.query to handle term queries