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 EDCF7200B67 for ; Tue, 16 Aug 2016 10:45:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EC658160AA8; Tue, 16 Aug 2016 08:45:50 +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 1687B160A76 for ; Tue, 16 Aug 2016 10:45:49 +0200 (CEST) Received: (qmail 76585 invoked by uid 500); 16 Aug 2016 08:45:48 -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 76565 invoked by uid 99); 16 Aug 2016 08:45:48 -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; Tue, 16 Aug 2016 08:45:48 +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 D22CEC18F7 for ; Tue, 16 Aug 2016 08:45:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 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, 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 dEdiFCY1F4Ka for ; Tue, 16 Aug 2016 08:45:44 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A3EA45FB8F for ; Tue, 16 Aug 2016 08:45:43 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id q128so130447493wma.1 for ; Tue, 16 Aug 2016 01:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=pllgbtjPi1wJVgrppraMzGI2obMu0E8kdX8mgZCaNO4=; b=IVPfyaeLBffuV8OalcVdUWPMUIab2bT7NQx35poyV9UFwOYey9HCagGnmyuiJ1ychs +VbUCAQ4am14pWawNBJIjFZL1k4fk7MO63A/6xZh/8MXlhDm7ciUuRPKohPKsK+HwmH3 DhYH+g8j+h4gr7XOohFxnNUZvMcWaAEcWWfxjGUD2mq6mt0dYGgQ0f8o0S37d5KMyzT+ NNKDTJjxemi/L/c3zuVP28gx1UFlmv8DJ7j/LmgAeMVpNCyqqDuT6SAVW6GvI8QB8Y2w HlBabemJdEoAzdGkMVVLpc8u+SPEShljfii5DRrGnnNoHyq9z8ll0aTKeW0yaiTZCXhn FndQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=pllgbtjPi1wJVgrppraMzGI2obMu0E8kdX8mgZCaNO4=; b=Lhax3jYwp3DOvq3Zmd3O7o8baRrxbg7QCFADXKRnms9fLhNpxSnIAqw52OrFqQQ8uj RkYdAKGVqOOFDm5k2+dpRukW2Q6Qym4IOHyQFUAXreT+QrDKDFvCTrKoOhxH8w4+IwAY mpP5+jj++SIxraBzGbAqfuGllR2g/1m+PLXbLwRICr+GrhmuOhFyVuSrkDV+ZS7q9xdI TzN+CFPwiLlHiLkfpN/84Jy74sw5potegc8pyMJtHRTDmFgZzofedEFKyTApCrDMTh8x 9QR/rGXS2JhV3Kav8evu8GKfE47y48fsnEH4g6dOynVINxE3saSgNWlUPcWThttsTteH XY3A== X-Gm-Message-State: AEkoouuyRhQm6IH8HH7W9RgYHjaE4WheArO+g6rUp0GTP3LV2KZk/ydtCJgiNisb6ccyxTnS8nktioUdv90a+Q== X-Received: by 10.46.0.17 with SMTP id 17mr5835753lja.54.1471337143131; Tue, 16 Aug 2016 01:45:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adrien Grand Date: Tue, 16 Aug 2016 08:45:32 +0000 Message-ID: Subject: Re: LUCENE-6766 index sorting and custom SortField To: java-user@lucene.apache.org, =?UTF-8?Q?Andres_de_la_Pe=C3=B1a?= Content-Type: multipart/alternative; boundary=001a1142af6cc2e3a7053a2c5f3c archived-at: Tue, 16 Aug 2016 08:45:51 -0000 --001a1142af6cc2e3a7053a2c5f3c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Maybe another way would be to create a custom SegmentInfoFormat that handles the serialization of this custom SortField. That would put the burden on the user to handle backward compatibility, but on the other hand it would not require SortFields to handle their own serialization? It would not work today since IndexWriterConfig does its own checks, but maybe this is something we can fix to allow for custom sort orders? Le lun. 15 ao=C3=BBt 2016 =C3=A0 20:57, Michael McCandless a =C3=A9crit : > Hmm I see. Yeah, it seems like the only way forward is to explore > SortField (and its subclasses) handling their own serialization, maybe vi= a > SPI (what we use for codecs), though that sounds somewhat heavy. Maybe > open an issue for discussion? > > Mike McCandless > > http://blog.mikemccandless.com > > On Mon, Aug 15, 2016 at 12:12 PM, Andres de la Pe=C3=B1a > > wrote: > > > Hi, > > > > We are using a custom SortField > > < > https://github.com/Stratio/cassandra-lucene-index/blob/branch-3.0.8/plugi= n/src/main/java/com/stratio/cassandra/lucene/key/KeySort.java > > > > to sort Cassandra primary keys. The sort criteria is based on the > > marshalled values of each of the columns in the primary key, so it is n= ot > > trivial at all to compute an equivalent collated value to be indexed in > doc > > values. > > > > Maybe it could be possible to define how to do this > > serialization-deserialization when extending SortField. This way it wil= l > be > > possible to recover this lost Lucene 5.x feature, don't you think so? > > > > Thanks, > > > > 2016-08-14 23:09 GMT+01:00 Michael McCandless >: > > > >> Unfortunately, as of LUCENE-6766, index sorting only supports simple > sort > >> types. This was needed because Lucene needs to be able to easily > serialize > >> and de-serialize the sort order into the index. > >> > >> Can you compute your sort criteria and index it as a doc values field > and > >> then sort by that? > >> > >> Or, patches welcome too ;) > >> > >> Mike McCandless > >> > >> http://blog.mikemccandless.com > >> > >> On Sun, Aug 14, 2016 at 7:19 AM, Andres de la Pe=C3=B1a < > adelapena@stratio.com > >> > wrote: > >> > >>> Hi, > >>> > >>> LUCENE-6766 allows to define index sorting on IndexWriterConfig inste= ad > >>> of > >>> defining a SortingMergePolicy. However, the new index sorting only > >>> supports > >>> some types of sort fields, and the old SortingMergePolicy, which didn= 't > >>> have this limitation, has been removed. > >>> > >>> What should do projects depending on index sort with custom SortField= s? > >>> Ignore the new index writer sorting and build their own old-style > sorting > >>> merge policy? > >>> > >>> Thanks, > >>> > >>> -- > >>> Andr=C3=A9s de la Pe=C3=B1a > >>> > >>> V=C3=ADa de las dos Castillas, 33, =C3=81tica 4, 3=C2=AA Planta > >>> 28224 Pozuelo de Alarc=C3=B3n, Madrid > >>> Tel: +34 91 828 6473 // www.stratio.com // *@stratiobd > >>> * > >>> > >> > >> > > > > > > -- > > Andr=C3=A9s de la Pe=C3=B1a > > > > V=C3=ADa de las dos Castillas, 33, =C3=81tica 4, 3=C2=AA Planta > > 28224 Pozuelo de Alarc=C3=B3n, Madrid > > Tel: +34 91 828 6473 // www.stratio.com // *@stratiobd > > * > > > --001a1142af6cc2e3a7053a2c5f3c--