Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 98819 invoked from network); 3 Jul 2008 07:57:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 07:57:33 -0000 Received: (qmail 46640 invoked by uid 500); 3 Jul 2008 07:57:33 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 46614 invoked by uid 500); 3 Jul 2008 07:57:33 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 46602 invoked by uid 99); 3 Jul 2008 07:57:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 00:57:33 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbbellet@goojet.com designates 84.14.163.131 as permitted sender) Received: from [84.14.163.131] (HELO trinity.anyware-tech.com) (84.14.163.131) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 07:56:39 +0000 Received: from localhost (localhost [127.0.0.1]) by trinity.anyware-tech.com (Postfix) with ESMTP id 50A41400DC6 for ; Thu, 3 Jul 2008 09:56:58 +0200 (CEST) Received: from trinity.anyware-tech.com ([127.0.0.1]) by localhost (trinity.anyware-tech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10441-05 for ; Thu, 3 Jul 2008 09:56:57 +0200 (CEST) Received: from [10.0.0.198] (122.57-14-84.ripe.coltfrance.com [84.14.57.122]) by trinity.anyware-tech.com (Postfix) with ESMTP id 7537B400122 for ; Thu, 3 Jul 2008 09:56:57 +0200 (CEST) Message-ID: <486C8644.5010804@goojet.com> Date: Thu, 03 Jul 2008 09:56:52 +0200 From: Jean-Baptiste Bellet User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Re: Birthdate query References: <4869059C.4080305@goojet.com> <48691EE9.3000808@anyware-tech.com> <4869DEA4.9000207@anyware-tech.com> In-Reply-To: <4869DEA4.9000207@anyware-tech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Debian amavisd-new at anyware-tech.com X-Virus-Checked: Checked by ClamAV on apache.org Hi S�bastien, Thanks for your response. So, what you cleary said is Jackrabbit isn't able to make some of this basics operations over the Date format. Do you know if this is on the road map for futur version ? Because this type of operation could be very usefull ... Not only for my case of course ! If someone has another solution ... :) Thanks to all the team. jb S�bastien Launay wrote: > S�bastien Launay a �crit : >> Hi JB, >> >> None of the functions you describre are currently supported by >> Jackrabbit. >> A date property is stored in the lucene index using ISO8601 format for >> using < and > operator efficiency. > My mistake, in the fact that the date property is stored in ISO8601. > Indeed these properties are stored in a fixed length string suitable > for indexing and sorting which makes more sense :) : > http://fisheye6.atlassian.com/browse/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DateField.java?r=532464 > >> >> The most efficient way IMHO is to have another date property which will >> contain the same the value but with a same fixed year. >> The drawback is that you must maintain the integrity of the two fields at >> each update. >> >> But i think the duplicity is worth the effort hence it will consume >> more disk. >> >> Note that you will need to use >> xs:datetime('XXXX-06-30T00:00:00.000+00:00') >> with operator >= and <. >> >> You can also use a string property with month and day concatenated >> ("06/30") >> but the query will not be so fine grained (users born on the same hour >> :)). >> >> Best regards, >> >> S�bastien. >> >> Jean-Baptiste Bellet a �crit : >>> Hi, >>> >>> I'm using jackrabbit and I'm trying to execute a query in order to >>> retrieve 'users', registered in JCR, who have a birthdate >>> corresponding to the current date. >>> For example if a user was born on june the 30th, 1992 I want to >>> compare the user's birthdate with june the 30th (and without the year >>> wich is not important in this case). I have tried a lot of queries, >>> but without success. >>> Any idea on how to perform such a query? >>> Thanks a lot, >>> jb >>> >>> This one works: >>> //user[@birthDate = '1992-06-30T14:36:24.292+01:00'] >>> These do not work: >>> //user[substring(@birthDate, 1, 1) = '1'] >>> //user[substring(fn:string(@birthDate), 1, 1) = '1'] >>> //user[concat(substring(@birthDate, 6, 2), substring(@birthDate, >>> 9, 2)) = '0630'] >>> //user[fn:month-from-dateTime(@birthDate) = 6] >>> //user[fn:month-from-dateTime(./@birthDate/value()) = 6]