Facets42Codec has a nocommit about handling multiple category lists as well as if the default field has changed. Currently (in the patch), it hard-codes to "$facets", but that won't work if e.g. the app indexed categories into a different field.
Talking with Mike about it yesterday, I thought that what needs to be done is for the codec to receive the FacetIndexingParams, build a HashSet<String> of all fields that hold facets, and then use it in .getDocValuesFormatForField.
However, I realized later that this is not doable, since Codecs must have a default constructor, and b/c of how they are initialized, they cannot rely on stuff passed to them in the ctor (e.g. when they are initialized by a reader?). Is that true? I looked at few Codecs impl, and looks like none relies on stuff passed to it in the ctor.
If so, perhaps we should also override the FieldInfosFormat and use it to detect which fields are "facet" fields? E.g. it will be a subset of all fields that have BinaryDV. But that's not distinguishing enough ... and we cannot add a DVType, so cannot distinguish BINARY from FACETS_BINARY even if we wanted to make a different BinaryDV extension ...
Crazy, but can we write a boolean to FieldInfo hasFacets? Is it supported if we e.g. extend (I realize, many) classes?