Optimization in fielddata cache where ordinals are used instead of flat arrays when number of unique values is low