Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3251B200D1F for ; Fri, 29 Sep 2017 05:17:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 30B951609EC; Fri, 29 Sep 2017 03:17:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 765091609CD for ; Fri, 29 Sep 2017 05:17:21 +0200 (CEST) Received: (qmail 29482 invoked by uid 500); 29 Sep 2017 03:17:13 -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 29454 invoked by uid 99); 29 Sep 2017 03:17:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2017 03:17:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A9F64C1B5E for ; Fri, 29 Sep 2017 03:17:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.679 X-Spam-Level: * X-Spam-Status: No, score=1.679 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id h5KS-GfbBO2F for ; Fri, 29 Sep 2017 03:17:11 +0000 (UTC) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 00DBC5FB2E for ; Fri, 29 Sep 2017 03:17:10 +0000 (UTC) Received: by mail-it0-f54.google.com with SMTP id v62so928414itd.0 for ; Thu, 28 Sep 2017 20:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=X6MwOa/giXPxmQ46O2mMOS2yXwzFUC1oiOHN+rolmWU=; b=OW+5T2vrPprl6sLhq1vQyuP/qcFQGyG6w2oFgpuGC9DXAi1m+I/fEp5B+AaMZuRXbr Cn5/t35efTr64W0gmHtCSNIQhJmW1/aI2bZ4wlgCOHwvbrcOHlDXeGhGWcKc3yLgJjWk KMGR5bWmSrrQGUaoZBI5uPkXhWcMZaSzksPELDZ6AWLYbXwHYoxntma/PbZMCaRYcQOB QSZGUPRcceIcFnM+aM4Ndcb4h5eFh3JUVTVXhcUPYjDacKzHD0Dmoizv0NzlPcrpCkW9 IHX97h/rHZoG5Fov6aPfvcxUzVSxzCMJnW9NIlX6pu9IBg+klsTQWpAA/EGTPV8o+LHO zhoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=X6MwOa/giXPxmQ46O2mMOS2yXwzFUC1oiOHN+rolmWU=; b=QU84ELn4A5UhpLxNeuZrjBOoNGKe+gOjkihgfiajAdu9GvzB4hptljkIfzQshWdKLl GTjuYV46czcdTXgCVAiV949Uc9aBf4rpEc3CJ++qLnq7tEyYd81NcTFShUdWyboGogu3 toc7PndrgkHHqWvoLiEPfj8+vMgSQHZ3xL3dGV2HyQ25Wp96K/DC4cevHCI6bbyyq9KT OUPz0+wdh3jMohBj9yxpei5ULdRod0uwG95JwxfaBvqYYJ8ml3NSqRx2UN7wRYGb5cPi iJQQcdJyga82yVNWOHHb6uJMVAvp1ML01SdbaO/LmDGJZm5VS3UNA2XgiX6Mihsvnds2 7PJg== X-Gm-Message-State: AMCzsaUE8916m7O//YgvIEoT1zCF4i/pdGrVkCmRVupS4EX0PnDZ50YW wEKlSuM38gATlgqzfhOomzFnpAtyX6U95rYEYgc= X-Google-Smtp-Source: AOwi7QBPFzybdkJ1PH25zcsCORZuAYVUe74JixRxEaX+ljtCo8E0LTwnQ/BVN6YEImicNLvYP7dJelqEpp/+OEtoI1A= X-Received: by 10.36.122.68 with SMTP id a65mr4663965itc.97.1506655029734; Thu, 28 Sep 2017 20:17:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.3.161 with HTTP; Thu, 28 Sep 2017 20:17:09 -0700 (PDT) In-Reply-To: <09c301d33880$ab8ed3f0$02ac7bd0$@thetaphi.de> References: <09c301d33880$ab8ed3f0$02ac7bd0$@thetaphi.de> From: Yonghui Zhao Date: Fri, 29 Sep 2017 11:17:09 +0800 Message-ID: Subject: Re: TieredMergePolicy disrupts doc id order after merge To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary="001a11405e92d8b1be055a4b7503" archived-at: Fri, 29 Sep 2017 03:17:22 -0000 --001a11405e92d8b1be055a4b7503 Content-Type: text/plain; charset="UTF-8" Got it, thanks Uwe! 2017-09-29 1:39 GMT+08:00 Uwe Schindler : > Hi, > > Use another merge policy, see LogMergePolicy subclasses! Those preserve > order, but are not merging in ideal ways. > > In general: Relying on internal Lucene DocIDs is not guaranteed to work, > this is only an implementation detail. The internal IDs are also not > stable!!! > > Uwe > > ----- > Uwe Schindler > Achterdiek 19, D-28357 Bremen > http://www.thetaphi.de > eMail: uwe@thetaphi.de > > > -----Original Message----- > > From: Yonghui Zhao [mailto:zhaoyonghui@gmail.com] > > Sent: Thursday, September 28, 2017 2:50 PM > > To: java-user@lucene.apache.org > > Subject: TieredMergePolicy disrupts doc id order after merge > > > > Hi, > > > > It is easier to elaborate my question with an example. > > > > My lucene version is 4.10.4 > > > > I use > > > > SortField sortField = new SortField(null, SortField.Type.DOC, true); > > sort = new Sort(sortField); > > return new SortingMergePolicy(new TieredMergePolicy(), sort); > > > > > > to make sure my index merger will make fresh documents in the beginning > of > > merged segment. > > > > TieredMergePolicy will chose biggest segments to merge, so the merge > order > > should be size descending order. > > > > Say we have 2 segments, segment 0 size is smaller than segment 1, after > > size sorting merge readers are (segment 1, segment 0), after merge all > > docs in segment 1 are in front of segment 0. > > > > This doesn't satisfy my requirement. > > > > If merge readers will be restored to origin order after TieredMergePolicy > > findMerges, then this problem will be fixed. > > > > Any problem of this solution? > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --001a11405e92d8b1be055a4b7503--