From java-user-return-63745-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri May 25 12:50:19 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 223A5180627 for ; Fri, 25 May 2018 12:50:18 +0200 (CEST) Received: (qmail 65109 invoked by uid 500); 25 May 2018 10:50:10 -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 65093 invoked by uid 99); 25 May 2018 10:50:09 -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, 25 May 2018 10:50:09 +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 85542C0157 for ; Fri, 25 May 2018 10:50:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.899 X-Spam-Level: * X-Spam-Status: No, score=1.899 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_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=zohocorp.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 nsaKL5VOHWRk for ; Fri, 25 May 2018 10:50:08 +0000 (UTC) Received: from sender-c7.zoho.com (sender-c7.zoho.com [135.84.80.193]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id AA9A95F41B for ; Fri, 25 May 2018 10:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1527245397; s=admin; d=zohocorp.com; i=chellasamy.g@zohocorp.com; h=Date:From:To:Message-Id:In-Reply-To:References:Subject:MIME-Version:Content-Type; l=8174; bh=FZeYTKsknGoD7xene8mJRe/RpHGxOaPgfNfQcG2KXxY=; b=EuLU8u8ksFcMo8BTVAJblWe18f2/NsBFMNrzts313/VLZB8rhA10zMkCezxw9j1+ 4Eh670nG0jAkD4mwlZ+uTYeFSOs2a+bzcAyVI1w4Nrwl16ZgM320HdQsanSgWU/NNO1 zzOF/3h6Adhs03CmSv6MRJVNFjjaWJk+epsevscY= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 152724539792794.03307741580966; Fri, 25 May 2018 03:49:57 -0700 (PDT) Date: Fri, 25 May 2018 16:19:57 +0530 From: Chellasamy G To: "java-user" Message-Id: <16396eb5fa4.c74a0fe79762.7737924360390540830@zohocorp.com> In-Reply-To: <1638c56f5af.bd82ebfd11635.2068950216529022461@zohocorp.com> References: <1638bb619cb.112157cd09919.5320064041070473546@zohocorp.com> <1638c56f5af.bd82ebfd11635.2068950216529022461@zohocorp.com> Subject: Re: Case Insensitive Search for StringField MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_28790_1524859186.1527245397925" X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail ------=_Part_28790_1524859186.1527245397925 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Team, Kindly help me out with this problem. Thanks, Satyan ---- On Wed, 23 May 2018 15:01:39 +0530 Chellasamy G <chellasamy.g@zohoc= orp.com> wrote ---- Hi,=20 =20 =20 =20 Thanks for the reply.=20 =20 =20 =20 Actually I need to implement it for StringField which is non-analyzed. So, = if I am not wrong I can't add the analyzer for StringField.=20 =20 =20 =20 =20 =20 My scenario is something similar to the one discussed in the below thread,= =20 =20 =20 =20 https://discuss.elastic.co/t/es-5-0-case-insensitive-search-for-keyword-fie= lds/64111/10=20 =20 =20 =20 Could you please let me know how to do the same the thing in lucene.=20 =20 =20 =20 =20 =20 Thanks,=20 =20 Satyan=20 =20 =20 =20 =20 =20 =20 ---- On Wed, 23 May 2018 12:09:31 +0530 Adrien Grand &lt;jpountz@gmail.= com&gt; wrote ----=20 =20 =20 =20 =20 Hi Satyan,=20 =20 =20 =20 You need to add a LowercaseTokenFilter to your analysis chain. The way to= =20 =20 do it depends on how you are building your analyzer today (pre-built=20 =20 analyzer, extending Analyzer or using CustomAnalyzer). This will preserve= =20 =20 the original case in field values because lowercasing will only be applied= =20 =20 to the content of the inverted index, not stored fields where hits are=20 =20 fetched from.=20 =20 =20 =20 Le mer. 23 mai 2018 =C3=A0 08:36, Chellasamy G &lt;chellasamy.g@zohocor= p.com&gt; a=20 =20 =C3=A9crit :=20 =20 =20 =20 &gt;=20 =20 &gt;=20 =20 &gt; Hi,=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt; I can't find any way to perform case insensitive search on StringF= ield.=20 =20 &gt; Please help me out.=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt; i.e If the field value is "Flying Robots", then the phrases "flyin= g=20 =20 &gt; robots", "fLying RObots" etc should match the value.=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt; I also need the original case of the field value to be preserved i= n the=20 =20 &gt; search results.=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt; Thanks,=20 =20 &gt;=20 =20 &gt; Satyan=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 &gt;=20 =20 =20 =20 =20 =20 =20 ------=_Part_28790_1524859186.1527245397925--