From user-return-10433-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue May 11 22:12:44 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 68939 invoked from network); 11 May 2010 22:12:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 May 2010 22:12:44 -0000 Received: (qmail 71933 invoked by uid 500); 11 May 2010 22:12:43 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 71898 invoked by uid 500); 11 May 2010 22:12:43 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 71890 invoked by uid 99); 11 May 2010 22:12:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 22:12:43 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jochenkempf@gmail.com designates 74.125.83.180 as permitted sender) Received: from [74.125.83.180] (HELO mail-pv0-f180.google.com) (74.125.83.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 22:12:37 +0000 Received: by pvg2 with SMTP id 2so238788pvg.11 for ; Tue, 11 May 2010 15:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=VsQqJK+R5gEVyjuwM38UDp1yJoVy+ckZIk2htCOuhCo=; b=imW7Ygv5M/MS4CfFDYLa0mLrYIc0vl2/wZDy9z6BVFJAmd2hzFPeCCGwM4vNYIZiU5 IzcNkohGDxuvwMWFEU7gFPrz0Ddz7ox5uygAuGitGxzf1J1Sy8XcbNjXCq2BBsMzkS63 oS+4ZHYsbczUg82+P2/F5DeNKF5UFdIjMUgk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gzJG6+ZiYDkETPiORtWmqAr9cQNDo/kZfuHd8hJKaK6eNsPjvOUL9L3kDB0oRt7twe KFWoX/H2nReLYZDlaQrLTSkWdybG6aZs3LKcH4tGjthzypO+wkslwlmDFk/FfAVoh2WH 8S0/QCFqtxitiPpnzOJkHr4VfmAVY4Kza0Cvo= Received: by 10.115.148.18 with SMTP id a18mr5021419wao.229.1273615935107; Tue, 11 May 2010 15:12:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.115.51.15 with HTTP; Tue, 11 May 2010 15:11:55 -0700 (PDT) In-Reply-To: References: From: Jochen Kempf Date: Tue, 11 May 2010 18:11:55 -0400 Message-ID: Subject: Re: Problems with date field in Lucene To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e64bf24e647829048658d14e X-Virus-Checked: Checked by ClamAV on apache.org --0016e64bf24e647829048658d14e Content-Type: text/plain; charset=ISO-8859-1 I just realized that I cannot sort the query result by a date type field. I tried it using the following queries: ?'sort=\date'&q=date:[2010-02-10 TO 2010-05-10] ?'sort=date'&q=date:[2010-02-10 TO 2010-05-10] and got always the same result: { "q": "date:[1265770800000 TO 1273464000000]", "plan": "NumericRangeQuery(1265770800000 TO 1273464000000 AS Long,boost=1.0)", "etag": "1a28be0d8443", "skip": 0, "limit": 25, "total_rows": 3, "search_duration": 2, "fetch_duration": 1, "rows": [ { "id": "488f231a58b84f745fca058c4b3dd03d", "score": 1, "fields": { "date": "1273464000000" } }, { "id": "488f231a58b84f745fca058c4b5ca2e1", "score": 1, "fields": { "date": "1267498800000" } }, { "id": "488f231a58b84f745fca058c4b5c99cf", "score": 1, "fields": { "date": "1268103600000" } } ] } Am I doing something wrong? 2010/5/10 Jochen Kempf > Thanks - that indeed fixed the issue! > > 2010/5/10 Robert Newson > > Please ensure you are using the 0.5.0 release, several date-related >> bugs were fixed a few days before the release. >> >> To be sure you have the right artifacts, consider using the official >> zip: >> http://github.com/downloads/rnewson/couchdb-lucene/couchdb-lucene-0.5.0-dist.zip >> >> B. >> >> On Mon, May 10, 2010 at 4:20 PM, Jochen Kempf >> wrote: >> > Hi, >> > I am trying to add a date field to a index view in CouchDB Lucene but >> > whatever I try I always get a "caused Unable to parse the date: >> > ORG.MOZILLA.JAVASCRIPT.NATIVEDATE@19E11A1" error. >> > >> > Here is the easiest code example I tried: >> > >> > "index":"function(doc) { >> > var result = new Document(); >> > var mydate = new Date(2010, 4, 10); >> > result.add(mydate, {'field':'mydate', 'type': 'date', 'store':'yes'}); >> > result.add(doc.year, {'field':'year', 'store':'yes'}); >> > result.add(doc.month, {'field':'month', 'store':'yes'}); >> > result.add(doc.day, {'field':'day', 'store':'yes'}); >> > return result; >> > }" >> > Any suggestions? >> > >> > > --0016e64bf24e647829048658d14e--