Add const_matching flag to dataSample function