title: Elasticsearch MapperParsingException[failed to parse, document is empty] during indexing
body: <p>I am using elasticsearch 1.2.2 with php wrapper elastica </p>
  
  <p>while indexing some documents i encountered the following exception</p>
  
  <pre><code>PHP Fatal error:  Uncaught exception 'Elastica\Exception\Bulk\ResponseException' with message 'Error in one or more bulk request actions:
  
  index: /en_search/en_msg/936 caused MapperParsingException[failed to parse, document is empty]
  ' in /root/search/vendor/ruflin/elastica/lib/Elastica/Bulk.php:395
  Stack trace:
  #0 /root/search/vendor/ruflin/elastica/lib/Elastica/Bulk.php(345): Elastica\Bulk-&gt;_processResponse(Object(Elastica\Response))
  #1 /root/search/vendor/ruflin/elastica/lib/Elastica/Client.php(284): Elastica\Bulk-&gt;send()
  #2 /root/search/vendor/ruflin/elastica/lib/Elastica/Index.php(147): Elastica\Client-&gt;addDocuments(Array)
  #3 /root/search/vendor/ruflin/elastica/lib/Elastica/Type.php(187): Elastica\Index-&gt;addDocuments(Array)
  #4 /root/search/setData.php(36): Elastica\Type-&gt;addDocuments(Array)
  #5 {main}
    thrown in /root/search/vendor/ruflin/elastica/lib/Elastica/Bulk.php on line 395
  </code></pre>
  
  <p>Now the the document that it fails to parse is this one which is obviously not empty.</p>
  
  <pre><code>array(
      [id] =&gt; 936
      [uid] =&gt; 3222
      [msid] =&gt; 211
      [login] =&gt; user1222
      [msg] =&gt; Wouldn’t you love a cup right now?
  )
  </code></pre>
  
  <p>document mapping was something like this</p>
  
  <pre><code>$mapping-&gt;setProperties(array(
      'id'  =&gt; array('type' =&gt; 'integer', 'include_in_all' =&gt; true),
      'uid' =&gt; array('type' =&gt; 'integer', 'include_in_all' =&gt; true),
      'msid' =&gt; array('type' =&gt; 'integer', 'include_in_all' =&gt; true),
      'login' =&gt; array('type' =&gt; 'string', 'include_in_all' =&gt; TRUE),
      'msg'  =&gt; array('type' =&gt; 'string', 'include_in_all' =&gt; true), 
  
  ));
  </code></pre>
  
  <p>doing indexing in bulk mode as suggested here 
  <strong><a href="http://elastica.io/getting-started/storing-and-indexing-documents.html#section-bulk" rel="nofollow">elatica.io:  Bulk indexing</a></strong></p>
  
  <p>i  am pretty sure it's caused by <code>’</code> character. Not sure if it requires escaping . in case it does how do i escape such characters? </p>