Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 43985 invoked from network); 4 Oct 2010 04:14:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Oct 2010 04:14:14 -0000 Received: (qmail 19423 invoked by uid 500); 4 Oct 2010 04:14:12 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 19149 invoked by uid 500); 4 Oct 2010 04:14:08 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 19141 invoked by uid 99); 4 Oct 2010 04:14:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Oct 2010 04:14:07 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.48] (HELO mail-pw0-f48.google.com) (209.85.160.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Oct 2010 04:14:00 +0000 Received: by pwj8 with SMTP id 8so1730075pwj.35 for ; Sun, 03 Oct 2010 21:13:38 -0700 (PDT) Received: by 10.142.11.18 with SMTP id 18mr561265wfk.262.1286165618718; Sun, 03 Oct 2010 21:13:38 -0700 (PDT) Received: from [10.0.1.90] (203-114-161-15.wir.sta.inspire.net.nz [203.114.161.15]) by mx.google.com with ESMTPS id y4sm2623104wfd.20.2010.10.03.21.13.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 03 Oct 2010 21:13:37 -0700 (PDT) Subject: Numeric range query not returning results From: Todd Nine Reply-To: todd@spidertracks.co.nz To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary="=-212IEdOz5TSXooICSivX" Organization: Spidertracks Date: Mon, 04 Oct 2010 17:13:07 +1300 Message-ID: <1286165587.15807.7.camel@greenlantern.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 --=-212IEdOz5TSXooICSivX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Hi all, I'm having some issues with Numeric Range queries not working as expected. My underlying storage medium is the Lucandra index reader and writer, so I'm not sure if this is an issue within Lucandra or with my usage of numeric field. My numeric range tests that are copies of Uwe's pass in the Lucandra, source, so I have a feeling it's my usage. I have a simple test case, with 5 people. I have a Date field, the LastLogin field. This date is converted to epoch milliseconds, and stored in the index in the following way. NumericField numeric = new NumericField("LastLogin"); numeric.setLongValue(fieldValue); doc.add(numeric); Where I have the following 2 field values on 2 documents. 1282197146L and 1282197946L I then perform the following query. NumericRangeQuery rangeQuery = NumericRangeQuery.newLongRange("LastLogin", 1282197146L, 1282197146L, true, true); IndexReader reader = new IndexReader(columnFamily, getContext(conn)); IndexSearcher searcher = new IndexSearcher(reader); TopDocs docs = searcher.search(query, maxResults); List documents = new ArrayList( docs.totalHits); Set fields = new HashSet(); fields.add(IndexDocument.ROWKEY); fields.add(IndexDocument.IDSERIALIZED); SetBasedFieldSelector selector = new SetBasedFieldSelector( fields, null); for (ScoreDoc score : docs.scoreDocs) { documents.add(reader.document(score.doc, selector)); } return documents; I'm always getting 0 documents. I know this is incorrect, I can see the values getting written to Cassandra when I run it in debug mode. Is this an issue with precision step, or an issue with the Lucandra index reader implementation? Thanks, Todd --=-212IEdOz5TSXooICSivX--