CDRH / orchid

Rails Engine for site integration with CDRH API
MIT License
3 stars 0 forks source link

Metadata method and nested fields (hashes) #297

Open wkdewey opened 7 months ago

wkdewey commented 7 months ago

When given an array of hashes metadata method fails if the value is not an array of hashes, but a single hash. A single hash is valid for the ES fields in question, so Orchid needs to be able to handle this

wkdewey commented 7 months ago

Example: when faceting on creator.name, the creator field may have a value like [{"name" => "Doe, John"}], but it will cause an error if it is {"name" => "Doe, John"}

techgique commented 7 months ago

I'm pretty sure if you just add a line like: creator=Array(creator) it will wrap creator in an array. If it's already an array, it won't hurt anything. I'd give that a try.