lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mukul Ranjan <mran...@egain.com>
Subject RE: get enumeration of all terms starting at a given term after lucene 4
Date Fri, 29 Jul 2016 13:30:16 GMT
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 = MultiFields.getTerms(reader, TEXT_FIELD); TermsEnum
> >termsEnum = terms.iterator();
> >
> >Can anyone help me on this.

Hi Mukul,

How about using PrefixTermsEnum like:

Terms terms = MultiFields.getTerms(reader, TEXT_FIELD); TermsEnum termsEnum = 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<https://www.youtube.com/watch?v=dEwdFfWoyuE>
Success Story

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message