title: Why is the elasticsearch index not updating in my mongo rails app?
body: <p>I'm using the tire gem in my rails 3.2 mongo app and I am having issues with elasticsearch not updating. I included my question model below.</p>
  
  <pre><code>class Question
  
    include Mongoid::Document
    include Mongoid::Timestamps
    include Mongoid::Paranoia
  
    field :question,  :type =&gt; String
    field :answer,    :type =&gt; Array
    field :tags,      :type =&gt; Array
    field :views,     :type =&gt; Integer, :default =&gt; 0
  
    include Tire::Model::Search
    include Tire::Model::Callbacks
  
    mapping do
      indexes :question,  :analyzer =&gt; 'snowball', :boost =&gt; 100
      indexes :tags,      :analyzer =&gt; 'keyword'
    end
  
  end
  </code></pre>
  
  <p>I create new questions by running  <code>Question.create(:question =&gt; "What day is it?", :answer =&gt; "Monday")</code> and it does not come when I search <code>Question.tire.search( "What day is it?" )</code>.  Older questions are showing up, but none of the new ones seem to be adding to the index.</p>
  
  <p><strong>Update</strong></p>
  
  <p>The following error message is showing in the log:</p>
  
  <pre><code>[2012-05-14 19:42:41,725][DEBUG][action.index             ] [Century, Turner] [questions][4], node[JKD6HjRKQuqgwuQyJTl1qA], [P], s[STARTED]: 
  Failed to execute [index {[questions][question][4fb1a677e0f5754d2e000004], source[_id=4fb1a677e0f5754d2e000004&amp;answer[]=Monday&amp;created_at=2012-05-14%2019%3A42%3A31%20-0500&amp;deleted_at=&amp;question=What%20day%20is%20it%3F&amp;tags=&amp;updated_at=2012-05-14%2019%3A42%3A31%20-0500&amp;views=0]}]
  org.elasticsearch.ElasticSearchParseException: Failed to derive xcontent from (offset=0, length=193): [95, 105, 100, 61, 52, 102, 98, 49, 97, 54, 55, 55, 101, 48, 102, 53, 55, 53, 52, 100, 50, 101, 48, 48, 48, 48, 48, 52, 38, 97, 110, 115, 119, 101, 114, 91, 93, 61, 77, 111, 110, 100, 97, 121, 38, 99, 114, 101, 97, 116, 101, 100, 95, 97, 116, 61, 50, 48, 49, 50, 45, 48, 53, 45, 49, 52, 37, 50, 48, 49, 57, 37, 51, 65, 52, 50, 37, 51, 65, 51, 49, 37, 50, 48, 45, 48, 53, 48, 48, 38, 100, 101, 108, 101, 116, 101, 100, 95, 97, 116, 61, 38, 113, 117, 101, 115, 116, 105, 111, 110, 61, 87, 104, 97, 116, 37, 50, 48, 100, 97, 121, 37, 50, 48, 105, 115, 37, 50, 48, 105, 116, 37, 51, 70, 38, 116, 97, 103, 115, 61, 38, 117, 112, 100, 97, 116, 101, 100, 95, 97, 116, 61, 50, 48, 49, 50, 45, 48, 53, 45, 49, 52, 37, 50, 48, 49, 57, 37, 51, 65, 52, 50, 37, 51, 65, 51, 49, 37, 50, 48, 45, 48, 53, 48, 48, 38, 118, 105, 101, 119, 115, 61, 48]
    at org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:147)
    at org.elasticsearch.common.xcontent.XContentHelper.createParser(XContentHelper.java:49)
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:431)
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:417)
    at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:311)
    at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:202)
    at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:529)
    at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:427)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
  </code></pre>