Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B08511E01 for ; Wed, 30 Jul 2014 06:21:57 +0000 (UTC) Received: (qmail 28635 invoked by uid 500); 30 Jul 2014 06:21:55 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 28567 invoked by uid 500); 30 Jul 2014 06:21:55 -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 28555 invoked by uid 99); 30 Jul 2014 06:21:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 06:21:55 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [80.12.242.126] (HELO smtp.smtpout.orange.fr) (80.12.242.126) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 06:21:51 +0000 Received: from [192.168.0.13] ([78.243.58.101]) by mwinf5d08 with ME id YWMS1o00B2B2nGW03WMSWe; Wed, 30 Jul 2014 08:21:26 +0200 X-ME-Helo: [192.168.0.13] X-ME-Auth: b2xpdmllci5iaW5kYUB3YW5hZG9vLmZy X-ME-Date: Wed, 30 Jul 2014 08:21:26 +0200 X-ME-IP: 78.243.58.101 Message-ID: <53D88EE5.8060706@wanadoo.fr> Date: Wed, 30 Jul 2014 08:21:25 +0200 From: Olivier Binda User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: How to get the Terms from the TermsEnum of an IntField ? Content-Type: multipart/alternative; boundary="------------090103040504050402000306" X-Virus-Checked: Checked by ClamAV on apache.org --------------090103040504050402000306 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hello. How do you get the terms for a TermsEnum of an IntField coded with precisionStc = Integer.Max that you get with MultiFields.getTerms(reader, intField).iterator(null) ? I had mitigated success trying to get the terms out of this iterator with NumericUtils.prefixCodedToInt I tried while (true) { BytesRef ref = termsEnum?.next() if (ref == null) break int value = NumericUtils.prefixCodedToInt(ref) } But it doesn't work (reliably) because of the trie structure I guess In an IntField with values 1,2,3,4,5 it worked But in an Int Field with all values from 1 to 2500, I got exceptions : lots of shifts aren't in the 0..31 range and it looks like there are "Blocks" with : first a term with shift 0 and value n followed by lots of terms with shift that aren't in 0..31 but who share the same prefix... Best regards, Olivier --------------090103040504050402000306--