I don't think we are handling each multiple times. Each value needs to be specified once on the query, by creating a term (and wrapping it around a TermQuery). What might help is an extension of TermQuery or Term that is able to take a list of values.