-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Strange searching results when using range query
PostPosted: Thu Apr 10, 2014 8:37 am 
Newbie

Joined: Thu Apr 10, 2014 8:13 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.