When you set the data type to "auto", the data type is inferred from the first document that you index. When subsequent documents are indexed, the fields are first attempted to be coerced to the previously determined data types. For eg:
If record1 has {field1: 32, field2: true, field3: '22'}
and record2 has {field1: "32", field2: 'true', field3: 22}
When record1 is indexed, the data type for field1 is set to int, field2 is set to bool and field3 is set to string.
Then when record2 shows up, field1 is coerced to an int, field2 is coerced to a bool and field3 is coerced to a string.
If a coercion is not possible, you can configure it to be ignored or error out.
re: facets, you can use a regex field name and set for example all fields that end with `.*_facet` to be a facet.
If record1 has {field1: 32, field2: true, field3: '22'} and record2 has {field1: "32", field2: 'true', field3: 22}
When record1 is indexed, the data type for field1 is set to int, field2 is set to bool and field3 is set to string.
Then when record2 shows up, field1 is coerced to an int, field2 is coerced to a bool and field3 is coerced to a string.
If a coercion is not possible, you can configure it to be ignored or error out.
re: facets, you can use a regex field name and set for example all fields that end with `.*_facet` to be a facet.