title: How to index and search an ENUM type with Hibernate-Search
body: <p>I am working in a Spring, Jpa, Hibernate-Search, Lucene application. I want to index a JPA entity which has a ENUM property and use Lucene to search on that. Every element in my ENUM has a int value.</p>
  
  <p>I put the @Field annotation on the property, but is not working. In the database the field is being stored as an Integer.</p>
  
  <pre><code>@Field
  @Enumerated
  private STATUS status = STATUS.FIRST;
  </code></pre>
  
  <p>Now I want to use Lucene for search using this field</p>
  
  <pre><code>//lucene query to search by that enum field 
  queryStatus.should(queryBuilder.keyword().onField("status").matching(1).createQuery());
  </code></pre>
  
  <p>I cannot change the enum storage to string type because it has other queries working and using this enum propoerty as an integer and I do not know how to index and use it.</p>