 <p>This is what I came up with. If you see any performance concerns, please let me know.</p> <pre><code>public class FilterByIntegerSetQuery extends Query { protected String numericDocValueFieldName; protected Set&lt;Integer&gt; allowedValues; public FilterByIntegerSetQuery(String numericDocValueFieldName, Set&lt;Integer&gt; allowedValues) { this.numericDocValueFieldName = numericDocValueFieldName; this.allowedValues = allowedValues; } @Override public Weight createWeight(IndexSearcher searcher, boolean needsScores) { return new RandomAccessWeight(this) { @Override protected Bits getMatchingDocs(LeafReaderContext context) throws IOException { final int len = context.reader().maxDoc(); final NumericDocValues values = context.reader().getNumericDocValues(numericDocValueFieldName); return new Bits() { @Override public boolean get(int index) { return allowedValues.contains((int) values.get(index)); } @Override public int length() { return len; } }; } }; } @Override public String toString(String field) { return "(filter "+numericDocValueFieldName+" by set)"; } } </code></pre>