move constrained logic up to inverted index