I would like to query my index to get all data to some date. Every row has a publication date and i would like to use this date to get my results using the actual day time.
protected Date publicationDate = new Date();
i have read in hibernate search in action book about using rangequery to query using dates. In luke i can get the data using this query [* TO NOW] but i can not do this with hibernate search.
andQuery.add(new TermQuery(new Term(field, "[* TO NOW]")), Occur.MUST);
i also tried:
TermRangeQuery rq = new TermRangeQuery(field, DateTools.dateToString(new Date(), DateTools.Resolution.SECOND), DateTools.dateToString(new Date(), DateTools.Resolution.SECOND),false, true);
none of these solutions helps me to get the data till actual date.
thanks in advance!