Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8A7B190D6 for ; Wed, 27 Apr 2016 05:06:18 +0000 (UTC) Received: (qmail 59716 invoked by uid 500); 27 Apr 2016 05:06:16 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 59662 invoked by uid 500); 27 Apr 2016 05:06:16 -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 59634 invoked by uid 99); 27 Apr 2016 05:06:16 -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; Wed, 27 Apr 2016 05:06:16 +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 C37C31A0543 for ; Wed, 27 Apr 2016 05:06:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.999 X-Spam-Level: **** X-Spam-Status: No, score=4.999 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=3, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nLeRu59br7Ff for ; Wed, 27 Apr 2016 05:06:10 +0000 (UTC) Received: from gwsmtp010.ril.com (unknown [203.199.41.20]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7E4F15F24E for ; Wed, 27 Apr 2016 05:06:07 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,540,1454956200"; d="scan'208,217";a="304430318" From: To: Subject: Problem with Analyzing Infix Suggester for Multiple Indexes. Thread-Topic: Problem with Analyzing Infix Suggester for Multiple Indexes. Thread-Index: AdGgQa6ksi4ViZ0KRqyz9Se5ElpO/Q== Date: Wed, 27 Apr 2016 05:00:18 +0000 Message-ID: <6d86c5e8c6224139aaa81a283fd717fe@SHYDEXMBX05.in.ril.com> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Content-Type: multipart/alternative; boundary="_000_6d86c5e8c6224139aaa81a283fd717feSHYDEXMBX05inrilcom_" MIME-Version: 1.0 --_000_6d86c5e8c6224139aaa81a283fd717feSHYDEXMBX05inrilcom_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Dear Team, I am on Lucene 5.4.0. We are trying to build Suggestions based on the alre= ady Indexed Data. (Say I have indexed field "Content") and the indexes are = available on the file server. Now, in order to use the suggestion feature, I am using AnalyzingInfixSugge= ster to first build the suggest indexes. For this, I have specified the fie= ld name as "Content" and provided another directory wherein the suggest ind= exes will be generated. My problem starts from here: a. The already indexed data contains two fields ("Content" and "Place= "). I want to build suggest indexes on both the fields and in the same dire= ctory. b. Having build the suggest indexes, I wish to add more suggest indexe= s on 3rd field or the existing 3 fields itself (Everytime I try to do this,= it removes the old indexes. c. No matter what I do, I am not able to understand how can I keep on= updating the suggest indexes with new data for 2 fields described above an= d additionally add new field itself to the suggester. d. While fetching the suggestions, I am anyhow not specifying any fiel= d. Is there a way to prepare suggest indexes field by field. (i.e. for fiel= d "Content", I have separate suggest indexes , for field "Place" I have sep= arate suggest indexes, but all of them inside the same directory. And a way= to specify to get suggestions from a specific field.) Code Snippet for Building Suggest Indexes: java.nio.file.Path path =3D FileSystems.getDefault().getPath("D:\\", "index= RawData"); FSDirectory phraseIndexdir =3D FSDirectory.open(path); String fieldContent=3D"Content"; Analyzer analyzerNormal =3D new StandardAnalyzer(); java.nio.file.Path path2 =3D FileSystems.getDefault().getPath(indexPath, "S= earch"); FSDirectory dir2 =3D FSDirectory.open(path2); aInfixSuggester=3Dnew AnalyzingInfixSuggester(dir2,analyzerNormal); IndexReader indexReader=3D DirectoryReader.open(phraseIndexdir); aInfixSuggester.build(new LuceneDictionary(indexReader, fieldContent)); Closing all open resources While searching, I specify the Search directory path as mentioned in path2 = above, and get the suggestions by firing the lookup. Would appreciate some guidance in this regard. Regards, Ankit "Confidentiality Warning: This message and any attachments are intended onl= y for the use of the intended recipient(s). = are confidential and may be privileged. If you are not the intended recipie= nt. you are hereby notified that any = review. re-transmission. conversion to hard copy. copying. circulation or o= ther use of this message and any attachments is = strictly prohibited. If you are not the intended recipient. please notify t= he sender immediately by return email. = and delete this message and any attachments from your system. Virus Warning: Although the company has taken reasonable precautions to ens= ure no viruses are present in this email. = The company cannot accept responsibility for any loss or damage arising fro= m the use of this email or attachment." --_000_6d86c5e8c6224139aaa81a283fd717feSHYDEXMBX05inrilcom_--