maybe it's worth mentioning that it only works on indexed fields, so a field that only has doc values wouldn't work