Minor style point: could you express this more clearly as

    fields[:index] = @index_names.find { |short_name| long_name.start_with? short_name }

That would assign `nil` to the `index` field if it doesn’t match, which might or might not be a problem.