title: How to find if a result is falling between 2 dates in the lucene index?
body: <p>I'm trying to find if the expiry date falls between today and another date specified. Though my database has results, the search query doesn't seem to fetch the value. Please help!</p>
  
  <p>This is the query that's being run:
  jpaQuery: FullTextQueryImpl(+membershipStatus:full_member +accountManager.firstName:nikki +expiryDate:[20190416 TO 20190516})</p>
  
  <p>Also, database has expiry date in YYYY-MM-dd HH:mm:ss format, not sure how to match the fields.</p>
  
  <p>This is the query:</p>
  
  <pre><code>Query expiringInQuery = queryBuilder
      .range()
      .onField("expiryDate")
      .ignoreFieldBridge()
      .from(DateTools.dateToString(today, DateTools.Resolution.DAY)) 
      .to(DateTools.dateToString(expiringDate, DateTools.Resolution.DAY))
      .excludeLimit()
      .createQuery();
  </code></pre>
  
  <p>This is on the entity:</p>
  
  <pre><code>@Field
  @Column(name = "expiryDate")
  @Temporal(TemporalType.TIMESTAMP)
  @JsonIgnore
  @IndexedEmbedded
  @DateBridge(resolution=org.hibernate.search.annotations.Resolution.DAY, encoding = EncodingType.STRING)
  private Date expiryDate;
  </code></pre>