Add the ability to override the field used for the facet

Also, generalize how we add the "optional flags" to the facet
definition