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 DA83518365 for ; Fri, 7 Aug 2015 07:36:49 +0000 (UTC) Received: (qmail 80224 invoked by uid 500); 7 Aug 2015 07:36:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 80111 invoked by uid 500); 7 Aug 2015 07:36:47 -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 79646 invoked by uid 99); 7 Aug 2015 07:36:47 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 07:36:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id F26031A99B8 for ; Fri, 7 Aug 2015 07:36:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id cf6bu_TcOyiv for ; Fri, 7 Aug 2015 07:36:35 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id AEE18428CC for ; Fri, 7 Aug 2015 07:36:34 +0000 (UTC) Received: by lagz9 with SMTP id z9so17257971lag.3 for ; Fri, 07 Aug 2015 00:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=T3o8/SHSCc9C6St72PzRoyKPNhA7VJwTqRMYTV7UXU0=; b=r2rQMF1ijRMsEIVXtBRdp1EcH8P3pduKUn8WvJLlekuEJ5lEOVaVb0NhSOBUldO2Q6 GEacrCu3M/0QkA0XoT7NiBPW9sZvgOOQHqMHRqV/8azyS/WxY4PAQgOMR237AzwheptS lna0njf9r1qWSa/NBBpX1c4UAjJH+fTRjgYeq62obh/7zg00S4xE6OyXsyAI7l8VBAkM 2uq6cUHDR5rAdSaTbLPn/Dm1YnFYogWxn0lp0/AndJPqccj2JBetjJ8u8cI7I4XSXfY8 kq75SYPCsfm7XYpj3e9SwuQyxTg6PIxZdRLIfolzAne/uLboQJQfJQ8STv2/vSCW0tR6 7XYw== X-Received: by 10.152.6.130 with SMTP id b2mr6312182laa.78.1438932903618; Fri, 07 Aug 2015 00:35:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.147.33 with HTTP; Fri, 7 Aug 2015 00:34:44 -0700 (PDT) In-Reply-To: References: From: Adrien Grand Date: Fri, 7 Aug 2015 09:34:44 +0200 Message-ID: Subject: Re: Mapping doc values back to doc ID (in decent time) To: java-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 On Fri, Aug 7, 2015 at 8:30 AM, Trejkaz wrote: > for (int ourId = 0; ourId < count; ourId++) > { > builder.clear(); > NumericUtils.longToPrefixCoded(ourId, 0, builder); > termsEnum.seekExact(builder.get()); > postingsEnum = termsEnum.postings(null, postingsEnum); > int docId = postingsEnum.nextDoc(); // only ever one value > } Does your application actually iterate in order over dense ids, or is it just for benchmarking purposes? Because if it does, you probably don't actually need seeking, you could just see what the current ID in the terms enum is. If you actually need seeking, then you should try to avoid MultiFields, it will call seedExact on each segment, while given what I see you could just stop after you found one segment with the value. -- Adrien --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org