CDRH / datura

Datura is a ruby gem that manages data (TEI-XML, CSVs, VRA-XML, etc) and populates Solr / Elasticsearch instances. Datura also generates HTML for the formats to allow serving the contents via web
6 stars 5 forks source link

Check for array in TEI to ES Person/People fields #171

Open techgique opened 4 years ago

techgique commented 4 years ago

The person and people fields require an array and will crash the transform/post if they are not: https://github.com/CDRH/datura/blob/dev/lib/datura/to_es/tei_to_es/fields.rb#L123

Adding a check or conversion to an Array object ought to prevent this crashing.

Also related to #170 , but assume that will require more discussion / thought and this may be a quicker "fix" for this mildly error-prone code.

wkdewey commented 2 years ago

Not sure whether recent development has fixed this issue

wkdewey commented 2 years ago

Currently it throws an elasticsearch error if it doesn't match the schema. I'm not sure error checking code on the Datura side would be helpful (unless we implement stricter schema checking).

karindalziel commented 2 years ago

I think since the elasticsearch schema will be more strict and throw an error if the post does not match the schema, we don't need to worry about this too much.