Hello!
I'm currently working on a project to search objects with a time range using hibernate search 4.5.0.final
When I used range query, the search results seems to behave unexpected.
The first problem seems to be a bug for .above() and .below().
When I used the query below, the unexpected results come out:
BooleanJunction<BooleanJunction> b = qb.bool(); b.should(qb.bool() .must(qb.range() .onField("windowFrom") .below(sv.getLoadFrom().getTimestamp()) .createQuery()) .must(qb.range() .onField("windowTo") .above(sv.getLoadTo().getTimestamp()) .createQuery()) .createQuery());
Then I tried with some kind of workaround like this:
b.should(qb.bool() .must(qb.range() .onField("windowFrom") .from(Long.parseLong("0")) .to(sv.getLoadFrom().getTimestamp()) .createQuery()) .must(qb.range() .onField("windowTo") .from(sv.getLoadTo().getTimestamp()) .to(Long.parseLong("1450704000000")) .createQuery()) .createQuery());
The search works just as I expected. So I believe that it should have some bugs for .above() or .below().
Could you please help me out to test it?
|