From java-user-return-63773-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Jun 8 16:55:22 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 123C6180608 for ; Fri, 8 Jun 2018 16:55:21 +0200 (CEST) Received: (qmail 59387 invoked by uid 500); 8 Jun 2018 14:55:20 -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 59374 invoked by uid 99); 8 Jun 2018 14:55:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2018 14:55:19 +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 89A221A0247 for ; Fri, 8 Jun 2018 14:55:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.82 X-Spam-Level: ** X-Spam-Status: No, score=2.82 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_COUK=0.85, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=flax-co-uk.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HL4BTCJgjGT3 for ; Fri, 8 Jun 2018 14:55:18 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D9FC75F49F for ; Fri, 8 Jun 2018 14:55:17 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id e16-v6so3855906wmd.0 for ; Fri, 08 Jun 2018 07:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flax-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9EDzVwFQMDgRBvPqWxlW+eGuVV5IWuXJQAPOVpk95Yo=; b=hgtQvXnS3ssz71U0e/c/DZC0qeqnFubEUMQtSLn2EDJQD0cGBC9VaLO0RJLQzzENfl hzv49d4r3FejQfK17l3IwH2EDfnaw0us+9gIFpdzxS1k/ds6P12L4wFDalXRywFlDE10 ZmW2AyzrEOjLSR1JEPF4Tf2pTlZgDtyJ44oGhswcbxMKtNEhdWbRZqCGphQes/+ve3qW bSWDh/W0b5JCfVN4ZsbRwnXfijZyi8v9UMZM90KHrOdGiW0f1A8JpsoUnJ5c1PqroeQ0 lM9ZoWsuo29rKfVfOOgsiR0l2Ef0irmInCN4QO+kg1aZzjz0wVci4ESeW5oROYZJ8Qci 4VnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9EDzVwFQMDgRBvPqWxlW+eGuVV5IWuXJQAPOVpk95Yo=; b=QFbdaNbzR+kX7vv5uE3hg/f7iV/3u4jYa2+QF6zRgf/hX8WhMlq9dGBFNsPe543d2k xMN2NOUOJf5zfxvXPPVAKIDAnAD1DC2djs5RaamE3X6htGvRYnHIUu5/+zBu1Y7H8ddC odcCf6dG/HfBH2I+7XE4xs0J9F7BKPGqKHf1x1Z/YvzAY7w9I8dyY4Qde2QtPrWuR3qS ND4/a5eFAPG/HzJftkF6RdjHZOYQfWbaVuhg4tJr6wxLl/7DdJJyRt3j4Evwelrak7Jd 6th8KDzFjt1W8wBoroL71fBjOTlYn8Ao5PgBclHbIKTQrfVIGH3EyxVk6Gg/s0DC56wI O+2w== X-Gm-Message-State: APt69E0pnXzQ9BTgFkuB5UGgmoH3C33KPOYAxADl3OGc+kVgoD70L5aQ sBPIC6Z9mw44yOEWFm0kmIJvsBNeJwP/H5/aODYF6BQN X-Google-Smtp-Source: ADUXVKJnMDyy3G8W5I9Ori/xoLoQm90wiZeCmUE1VJJ0KsKx87gjYPk+a50suExCkzf7OYOLntyt9jxBAbhzZHYglqU= X-Received: by 2002:a1c:f513:: with SMTP id t19-v6mr1953905wmh.50.1528469716598; Fri, 08 Jun 2018 07:55:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tom Mortimer Date: Fri, 8 Jun 2018 15:55:05 +0100 Message-ID: Subject: Re: Matching a single instance of a multivalued field To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary="00000000000082194b056e2296a8" --00000000000082194b056e2296a8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah, that's an interesting idea - thanks Adrien! On Fri, Jun 8, 2018 at 3:54 PM Adrien Grand wrote: > Hi Tom, > > One way to solve this could be to use block joins by indexing each value = in > its own document and joining the parent document using > ToParentBlockJoinQuery. > > Le ven. 8 juin 2018 =C3=A0 16:46, Tom Mortimer a =C3=A9c= rit : > > > Hi! > > > > I have a requirement to be able to restrict search results to a single > > instance of a multivalued field. e.g. with the doc: > > > > text: [ "striped skunk", "spotted hyena" ] > > > > the queries (skunk AND striped), (spotted AND hyena) should return the > > document, but (striped AND hyena), (skunk AND spotted) should not. > > > > Can anyone give me any suggestions how to do this? I was thinking that > > setting a massive position increment gap between multiple values and th= en > > using a SpanNearQuery with a large (but smaller than the gap) slop migh= t > do > > the job, but the field values could be quite long (I don't know if > there's > > a limit). Is there a neater way? > > > > cheers, > > Tom > > > --00000000000082194b056e2296a8--