Update term vector query to use bigquery when necessary