0

The goal is to have all my field names match the following schema of fields:

<field name="_version_" type="long" indexed="true" stored="true" />
<field name="_root_" type="string" indexed="true" stored="false" />
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="text" type="text_general" indexed="true" stored="false" required="false" multiValued="true" />
<dynamicField indexed="true" name="*_is" stored="true" type="int" multiValued="true" />
<dynamicField indexed="true" name="*_ls" stored="true" type="long" multiValued="true" />
<dynamicField indexed="true" name="*_fs" stored="true" type="float" multiValued="true" />
<dynamicField indexed="true" name="*_ds" stored="true" type="double" multiValued="true" />
<dynamicField indexed="true" name="*_bs" stored="true" type="boolean" multiValued="true" />
<dynamicField indexed="true" name="*_i" stored="true" type="int" />
<dynamicField indexed="true" name="*_s" stored="true" type="string" />
<dynamicField indexed="true" name="*_ss" stored="true" type="string" multiValued="true" />
<dynamicField indexed="true" name="*_txt" stored="true" type="text_general" multiValued="true" />
<dynamicField indexed="true" name="*_t" stored="true" type="text_general" />
<dynamicField indexed="true" name="*_l" stored="true" type="long" />
<dynamicField indexed="true" name="*_b" stored="true" type="boolean" />
<dynamicField indexed="true" name="*_f" stored="true" type="float" />
<dynamicField indexed="true" name="*_d" stored="true" type="double" />
<dynamicField indexed="true" name="*_tdt" stored="true" type="tdate" />
<dynamicField indexed="true" name="*_dt" stored="true" type="date" />
<uniqueKey>id</uniqueKey>

The reason for this is twofold:

  1. I am ingesting incoming CSV data that I do not control. I have a set of ~35 different field names that are one or two of the above.
  2. The schema is evolving constantly except for these 35 fields.

The goal is to conditionally the subsets of the ~35 to one of the above and anything that does not match one of those ~35 names gets appended with _s to make it a string.

Is this possible in Solr 6?

rotsner
  • 642
  • 3
  • 6
  • 23
  • Currently I ended up writing a python script that temporarily stores the data batches and updates the headers accordingly. – rotsner Nov 17 '16 at 17:57

1 Answers1

0

You could always just declare a dynamic field star (*) to have the type of string. This way you don't need to mangle the suffixes.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27