-->
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.  [ 5 posts ] 
Author Message
 Post subject: combining different query types
PostPosted: Tue Jan 05, 2010 10:09 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
Hi,
i'd like to get all entries matching "wired" (in field smthn) and having a docdate between 2009-12-01 and 2009-12-06 (for example).
tried it this way

smthn:wired AND doc.date:[20091201 TO 20091206]

but that wont work.

any help? thx!


Top
 Profile  
 
 Post subject: Re: combining different query types
PostPosted: Tue Jan 05, 2010 2:03 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

how do your annotated classes look like? Are you using a date bridge and which resolution do you use for the date bridge.
Have you checked the index (using Luke) to see the format in which the date gets stored?

--Hardy


Top
 Profile  
 
 Post subject: Re: combining different query types
PostPosted: Wed Jan 06, 2010 4:15 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
when i query the mentioned rangequery alone, it works fine, so i dont think its anything wrong with the format. by the way, i use the Datebridge with Resolution.Day, something like:
Code:
   @Field
   @DateBridge(resolution = Resolution.DAY)
   private Date      someDate = null;


Top
 Profile  
 
 Post subject: Re: combining different query types
PostPosted: Wed Jan 06, 2010 5:39 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
hm, if i query (with luke):

doc.date:20091202

i get one result, if i look up the doc.date field in the shown result, its empty. Is this because i dont use the store (default is store=Store.No, isnt it?) but only the @Field annotation? Otherwise i dont understand, why luke finds this entry.


Top
 Profile  
 
 Post subject: Re: combining different query types
PostPosted: Wed Jan 06, 2010 6:14 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
wellwell, i got it. I have another field with nearly the same name, and i always looked at (queried for) the wrong one. Obviously this couldnt get any results. really helpfull to use the store=Store.Yes annotation, for debugging issues using luke.

thx anyway

(conclusion: combining range and standard query works as expected)


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

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.