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 645DA179C0 for ; Mon, 13 Oct 2014 09:08:07 +0000 (UTC) Received: (qmail 8567 invoked by uid 500); 13 Oct 2014 09:08:05 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 8507 invoked by uid 500); 13 Oct 2014 09:08:05 -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 8496 invoked by uid 99); 13 Oct 2014 09:08:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2014 09:08:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of a_rexha@hotmail.com designates 157.55.1.140 as permitted sender) Received: from [157.55.1.140] (HELO DUB004-OMC2S1.hotmail.com) (157.55.1.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2014 09:07:37 +0000 Received: from DUB123-W12 ([157.55.1.136]) by DUB004-OMC2S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 13 Oct 2014 02:07:37 -0700 X-TMN: [k8M+kmv/9JOxj9R/CUrxIgMCDpXIxEHB] X-Originating-Email: [a_rexha@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_731d732e-cad0-4365-950b-cb9050668a81_" From: andi rexha To: "java-user@lucene.apache.org" Subject: Lucene Free Text Suggester, get only single tokens as suggestion! Date: Mon, 13 Oct 2014 11:07:36 +0200 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 13 Oct 2014 09:07:37.0108 (UTC) FILETIME=[220A4D40:01CFE6C5] X-Virus-Checked: Checked by ClamAV on apache.org --_731d732e-cad0-4365-950b-cb9050668a81_ Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Hi! I have a field in an index for which I want to have a "free text suggestion= ". The field is analyzed=2C storend and term vector the field. I tried to = use two approaches to get the suggestions from the field. I have tried to apply the free text suggester with a dictionary like :=20 FreeTextSuggester freeTextSuggester =3D new FreeTextSuggester(= new WhitespaceAnalyzer()=2C new WhitespaceAnalyzer()=2C 2)=3B Dictionary dict =3D new LuceneDictionary(reader=2C field)=3B freeTextSuggester.build(dict)=3B I have also tried a different approach=2C buy using the term vector element= s for each document: WFSTCompletionLookup wfstCompletionLookup =3D new WFSTCompleti= onLookup()=3B //it iterates over the term vector and is an InputIterator TermVectorInputIterator termVectorInputIterator =3D new TermVec= torInputIterator(reader=2C field)=3B wfstCompletionLookup.build(termVectorInputIterator)=3B I have an index with 916 documents=2C and approximately 32.000 terms=2C but= I always get as suggestion for a few characters input=2C single tokens sug= gestion=2C and not n-grams. Does anybody have any suggestion about my probl= em? Thank you in advance! = --_731d732e-cad0-4365-950b-cb9050668a81_--