Show arrays of objects in discover

Up until now, flattening a search response consisted of removing all fields without a mapping. In discover, we'd like to show fields that correspond to arrays of objects. This change checks if a field corresponds to an array, and doesn't strip it from the flattened response if it does.

Closes #1587.