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 7BC9D200B50 for ; Fri, 29 Jul 2016 15:44:49 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7A71C160A79; Fri, 29 Jul 2016 13:44:49 +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 9F6D9160A6E for ; Fri, 29 Jul 2016 15:44:48 +0200 (CEST) Received: (qmail 2125 invoked by uid 500); 29 Jul 2016 13:44: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 2113 invoked by uid 99); 29 Jul 2016 13:44:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 13:44:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B3533C0BCA for ; Fri, 29 Jul 2016 13:44:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.778 X-Spam-Level: X-Spam-Status: No, score=0.778 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=egain.onmicrosoft.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ur4z2lY01n0y for ; Fri, 29 Jul 2016 13:44:45 +0000 (UTC) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0080.outbound.protection.outlook.com [104.47.32.80]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id B9C925F4E9 for ; Fri, 29 Jul 2016 13:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egain.onmicrosoft.com; s=selector1-egain-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YxZcO1rMivUCPA/ErxSSULZqfjlaBKfLwodvBZZiVdw=; b=Xw3Avh/ZhQ1San3Od2qhoMQRGxZcS8Yz7Up8JKiXYQWA/i9jKVAKZkswSWapr/vOsu1fve5UdY8rvGlQMkuo2UAMuTAnT5Je/cCa+31dd2qeZcF2qOWHWY6de4hibQZpKKMPELCmXmAQTbGD70T+JuTwGAhc67y6K+LtT+pmto0= Received: from SN2PR0801MB2270.namprd08.prod.outlook.com (10.167.19.14) by SN2PR0801MB2272.namprd08.prod.outlook.com (10.167.19.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Fri, 29 Jul 2016 13:44:36 +0000 Received: from SN2PR0801MB2270.namprd08.prod.outlook.com ([10.167.19.14]) by SN2PR0801MB2270.namprd08.prod.outlook.com ([10.167.19.14]) with mapi id 15.01.0549.016; Fri, 29 Jul 2016 13:44:36 +0000 From: Mukul Ranjan To: "java-user@lucene.apache.org" Subject: RE: get enumeration of all terms starting at a given term after lucene 4 Thread-Topic: get enumeration of all terms starting at a given term after lucene 4 Thread-Index: AdHo6Ls1lAHPnfhSRq6ThodeYzOpjgAGRp8AABgPEXAAByIFgAAHphuwAABrfoAAABlloA== Date: Fri, 29 Jul 2016 13:44:35 +0000 Message-ID: References: <1469732226.728316.679646153.1DAB7CB3@webmail.messagingengine.com> <8076c7f9-4efb-be81-3b00-312d73a12e49@sib.swiss> <3a9f9bcc-ee6e-6423-b272-62a0983e9f57@sib.swiss> In-Reply-To: <3a9f9bcc-ee6e-6423-b272-62a0983e9f57@sib.swiss> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=mranjan@egain.com; x-originating-ip: [114.143.231.33] x-ms-office365-filtering-correlation-id: 4cd9997c-02d3-4f25-8683-08d3b7b67ac4 x-microsoft-exchange-diagnostics: 1;SN2PR0801MB2272;6:DIw3I4TKnc85ypfG9JuStR6ZU/gntF8KeEWDw93r+VSMqvMJzGVBqMDgyZnL1kUamSz1DTAvP0RewRW8ELw9AeKAZfztQ8BW+VKP2gZzHItRsGysdLKK0uzEhgVCxPoeeX4fbvqIQWonGajIoiOGYyOCH7zWmB7pqfq8ho/n+e1VFpD4lnpZSpNBCKtJBQHohlEZa5QsZHUXjr447M/VRb7Ep9jWFkoKEF4IX8J+fxpNmiU5lDt4drw36ah2dR+8kHcNm8Np9ePDCnkNoRIGfmVpavIMRbvWFsohuVwSaFo=;5:+ofjU9U0wqZxBiUhxxBvjM4s96z/zCuHFTVPtW3sD1prDU9BjifKq4HZP663snKYpuhhRd6Z5Mtt0slDTnSuJjjLbsSIiDZXd+A8Uwzbb1RiR2gUsXeO4pZKN0/sUF3pb2kGwuxSMBDxkN2Xc254lA==;24:edmFFTSVBN+v5q2E+HCCrTbg4CG1P/miAdUZ7j+4AyQEMduFU9luTir3XuS0eLencxidM+0v+LUsjoG3dgQQx25KKwtb1mVfTxWZHY70Jzw=;7:4jN4hed+k2PtNAtVVzLFNYKowSyJqjpfQAsGmAbdUFKluqKv03aYgnGH49pOZ2jfozJyzA9L/HAOqAqPNa3B+XYHGUNKRHDOXaseoyPZaYez/VL+PkEqWeZ4Me/DCOeiZNuFAv9D2fRqcJyK+9O89C6hN1HZThCT4DqS24Cf3WkkPrQ5/ekmF/fD7PnSt3Of4wunU4hn+tfy29aBc4UVmZdxKv6GNG7pXWuw2+/WUSrFyN3D5qpIhl41AZypPZJ2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR0801MB2272; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(263907834895145)(254730959083279)(91638250987450); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:SN2PR0801MB2272;BCL:0;PCL:0;RULEID:;SRVR:SN2PR0801MB2272; x-forefront-prvs: 0018A2705B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(24454002)(13464003)(252514010)(377454003)(50986999)(99286002)(101416001)(74316002)(7846002)(7736002)(102836003)(586003)(93886004)(110136002)(107886002)(450100001)(19580395003)(68736007)(7696003)(6116002)(76576001)(19580405001)(189998001)(92566002)(3846002)(3660700001)(54356999)(3280700002)(76176999)(305945005)(8936002)(5002640100001)(2900100001)(81156014)(105586002)(33656002)(15975445007)(11100500001)(2501003)(77096005)(2950100001)(10400500002)(81166006)(86362001)(87936001)(97736004)(8676002)(122556002)(2906002)(9686002)(2351001)(106356001)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR0801MB2272;H:SN2PR0801MB2270.namprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: egain.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: egain.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jul 2016 13:44:36.0051 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d60887ce-696b-4e9a-98db-a7266a25839f X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR0801MB2272 archived-at: Fri, 29 Jul 2016 13:44:49 -0000 Thanks Parit!!! I will try the below solution. Thanks, Mukul Ranjan -----Original Message----- From: Parit Bansal [mailto:Parit.Bansal@sib.swiss] Sent: Friday, July 29, 2016 7:11 PM To: java-user@lucene.apache.org Subject: Re: get enumeration of all terms starting at a given term after lu= cene 4 Hi Mukul, Provided terms are sorted how about doing if (termsEnum.seekExact(text)) { BytesRef text; while ((text =3D con.foreignTermsEnum.next()) !=3D null) { // keep looping till your value is a prefix } } - Parit On 07/29/2016 03:30 PM, Mukul Ranjan wrote: > Hi Parit, > > PrefixTermsEnum is removed in lucene 5.1 so we can not use this now. > > Thanks, > Mukul > > -----Original Message----- > From: Parit Bansal [mailto:Parit.Bansal@sib.swiss] > Sent: Friday, July 29, 2016 3:20 PM > To: java-user@lucene.apache.org > Subject: Re: get enumeration of all terms starting at a given term > after lucene 4 > > On 07/29/2016 08:27 AM, Mukul Ranjan wrote: >> lucene version from lucene 3.6 to lucene 5.5.2. After 3.6, >>> indexReader terms api is removed which used to give list of terms. >>> I have used below code to get the termEnum, but it has no option to >>> pass the value of the field which is used to get the matching result. >>> >>> Terms terms =3D MultiFields.getTerms(reader, TEXT_FIELD); TermsEnum >>> termsEnum =3D terms.iterator(); >>> >>> Can anyone help me on this. > Hi Mukul, > > How about using PrefixTermsEnum like: > > Terms terms =3D MultiFields.getTerms(reader, TEXT_FIELD); TermsEnum > termsEnum =3D new PrefixTermsEnum(tenum, terms.iterator()); > > - Best > Parit > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > ___ Watch an eGain Customer Service > Transformation Success > Story > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org ___ Watch an eGain Customer Service Transformation Success Story --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org