Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 56931 invoked from network); 30 Jun 2008 17:59:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jun 2008 17:59:36 -0000 Received: (qmail 28815 invoked by uid 500); 30 Jun 2008 17:59:36 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 28797 invoked by uid 500); 30 Jun 2008 17:59:36 -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 28785 invoked by uid 99); 30 Jun 2008 17:59:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 10:59:36 -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: local policy) Received: from [84.14.163.131] (HELO trinity.anyware-tech.com) (84.14.163.131) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 17:58:46 +0000 Received: from localhost (localhost [127.0.0.1]) by trinity.anyware-tech.com (Postfix) with ESMTP id 0B2F9400DC9 for ; Mon, 30 Jun 2008 19:59:05 +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 31483-08 for ; Mon, 30 Jun 2008 19:58:59 +0200 (CEST) Received: from [10.0.1.14] (cobra.anyware [10.0.1.14]) by trinity.anyware-tech.com (Postfix) with ESMTP id 8898E400DC3 for ; Mon, 30 Jun 2008 19:58:59 +0200 (CEST) Message-ID: <48691EE9.3000808@anyware-tech.com> Date: Mon, 30 Jun 2008 19:59:05 +0200 From: =?ISO-8859-1?Q?S=E9bastien_Launay?= 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> In-Reply-To: <4869059C.4080305@goojet.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 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. 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]