Help Exposing ICUCollationDocValuesField

I am in the process of writing a PR to expose ICUCollationDocValuesField as
a custom FieldMapper in the analysis-icu plugin. I have never really worked
with FieldMappers before and have a few questions:

  1. ICUCollationDocValuesField says "you should not create a new one for each
    document, instead just make one and reuse it during your indexing process". In
    the context of elasticsearch, does this mean I would do something like BinaryFieldMapper
    where its stored in the doc context? That appears to be per-doc, which would
    not be correct.

  2. Should I just use a BinaryFieldType or write a custom one? I am thinking
    something along the lines of:

    public static class Defaults {
          public static final MappedFieldType FIELD_TYPE = new BinaryFieldMapper.BinaryFieldType();
          static {
              FIELD_TYPE.setStored(false);
              FIELD_TYPE.setTokenized(false);
              FIELD_TYPE.setIndexOptions(IndexOptions.NONE);
              FIELD_TYPE.setHasDocValues(true);
              FIELD_TYPE.setDocValuesType(DocValuesType.SORTED);
              FIELD_TYPE.freeze();
          }
      }
  1. Anything else I need to consider?

Thanks,
Matt Weber

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.