title: How to handle nulls in an Elasticsearch index
body: <p>I have a SQL table that I am exporting to Elasticsearch.</p>
  <p>One of the columns is a numeric field that is nullable, with nulls in some of the records.</p>
  <p>When we try to index the table, we get this error:</p>
  <blockquote>
  <p>One of the ETL (BigQuery -&gt; ElasticSearch) jobs for Table : MLS has
  been ES Failed Chunk of 10000 from index 20000 possibly due to
  incompatible objects.</p>
  <pre><code>Failing BigQuery Table: MLS
  
  Stack Trace of the error:
  
  Traceback (most recent call last): File &quot;/Users/asif/zodiacbackend/zodiacbackend/tasks.py&quot;, line 205, in
  </code></pre>
  <p>insertIntoES helpers.bulk(es, doc_generator(dataframe,table)) File
  &quot;/Users/asif/zodiacbackend/env/lib/python3.7/site-packages/elasticsearch/helpers/actions.py&quot;,
  line 300, in bulk for ok, item in streaming_bulk(client, actions,
  *args, **kwargs): File &quot;/Users/asif/zodiacbackend/env/lib/python3.7/site-packages/elasticsearch/helpers/actions.py&quot;,
  line 230, in streaming_bulk **kwargs File
  &quot;/Users/asif/zodiacbackend/env/lib/python3.7/site-packages/elasticsearch/helpers/actions.py&quot;,
  line 158, in _process_bulk_chunk raise BulkIndexError(&quot;%i document(s)
  failed to index.&quot; % len(errors), errors)
  elasticsearch.helpers.errors.BulkIndexError: ('2 document(s) failed to
  index.', [{'index': {'_index': 'mls', '_type': 'mls', '_id':
  'b100qHABEFI45Lp-z3Om', 'status': 400, 'error': {'type':
  'illegal_argument_exception', 'reason': 'mapper [Lot_Size_Sq_Ft] of
  different type, current_type [text], merged_type [long]'}, 'data': {
  'Lot_Size_Sq_Ft': Decimal('13504')}}}])</p>
  </blockquote>
  <p>How do I get the system to recognize nulls?</p>