How to properly specify doc_values?

Seems there's two alternate ways to specify that a field should use docvalues:

"doc_values": True

and

"fielddata": {"format": "doc_values"}

What's the difference?

The docs suggest the first one.

Are you getting the second one from this blog post?