Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 70237 invoked from network); 6 Jul 2010 17:49:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Jul 2010 17:49:45 -0000 Received: (qmail 573 invoked by uid 500); 6 Jul 2010 17:49:43 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 475 invoked by uid 500); 6 Jul 2010 17:49:42 -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 464 invoked by uid 99); 6 Jul 2010 17:49:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 17:49:42 +0000 X-ASF-Spam-Status: No, hits=1.0 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of eduardop@occ.com.mx does not designate 97.65.90.20 as permitted sender) Received: from [97.65.90.20] (HELO srvestadisticas.occprod.com) (97.65.90.20) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 17:49:34 +0000 Received: from occm01 ([10.10.79.169]) by srvestadisticas.occprod.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 6 Jul 2010 12:55:34 -0500 From: "Eduardo Pierdant" To: Subject: Question: searching on a NumericField, with sort and filter Date: Tue, 6 Jul 2010 12:49:00 -0500 Organization: OCCMundial Message-ID: <496901cb1d33$85efbd50$91cf37f0$@occ.com.mx> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcsdMVliRQlRMRTeRhmfRHi8WmQ2fA== Content-Language: es-mx X-OriginalArrivalTime: 06 Jul 2010 17:55:35.0811 (UTC) FILETIME=[6F9AC530:01CB1D34] X-Virus-Checked: Checked by ClamAV on apache.org Hi all. I've been dealing with a small problem when searching and trying to sort and filter on a NumericField using Lucene 2.9.2; the result never comes back as expected. Here are some snippets of my code, so you might take a look and reference me or help me out to solve this problem. At document creation, I add the field like this: doc.add(new NumericField("PuntosJobSense", Field.Store.YES, false).setIntValue(Integer.parseInt(puntosJS))); When searching, I use a sort field and a Filter: SortField sf = new SortField("PuntosPatrocinadas", SortField.INT, true); Sort sortOrder = new Sort(sf); Filter nf = NumericRangeFilter.newIntRange("PuntosPatrocinadas", 0, Integer.MAX_VALUE, true, true); hits = searcher.search(query, nf, MAX_DOC_SEARCH, sortOrder).scoreDocs; the only "query" parameter that I'm passing so far is "date modified" that uses the date the document was added to the index. If I don't use this search and simply search without filter nor sorting, everything is ok. Hope someone can help me out. Eduardo --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org