title: How to search an int field in Lucene 4?
body: <p>I am trying to implement an index of documents (rougly corresponding to DB rows), where one of the fields is an integer. I'm adding them to index like:</p>
  
  <pre><code>Document doc = new Document();
  doc.add(new StringField("ticket_number", rs.getString("ticket_number"),
          Field.Store.YES));
  doc.add(new IntField("ticket_id", rs.getInt("ticket_id"),
          Field.Store.YES));
  doc.add(new StringField("id_s", rs.getString("ticket_id"),
          Field.Store.YES));
  w.addDocument(doc);
  </code></pre>
  
  <p>It seems I can't query the <code>ticket_id</code> field at all, while <code>id_s</code> works just fine.</p>
  
  <p>One of the documents is (I added whitespace for readability):</p>
  
  <pre><code>Document&lt;
      stored,indexed,tokenized,omitNorms,indexOptions=DOCS_ONLY&lt;ticket_number:230114W&gt; 
      stored&lt;ticket_id:152&gt; 
      stored,indexed,tokenized,omitNorms,indexOptions=DOCS_ONLY&lt;id_s:152&gt;&gt;
  </code></pre>
  
  <p>So my int field is stored, but not indexed. This query works as expected: <code>id_s:152</code>, while this one never returns anything: <code>ticket_id:152</code>.</p>
  
  <p>What am I doing wrong? How can I add such a field to the index and make it searchable?</p>