hetaphi.de
>>
>> eMail: u...@thetaphi.de
>>
>>
>>
>>
>>> -Original Message-
>>>
>>> From: adviner [mailto:eric.advinc...@gmail.com]
>>>
>>> Sent: Thursday, October 22, 2009 11:20 PM
>&
Uwe Schindler
>
> H.-H.-Meier-Allee 63, D-28213 Bremen
>
> http://www.thetaphi.de
>
> eMail: u...@thetaphi.de
>
>
>
>> -Original Message-
>
>> From: adviner [mailto:eric.advinc...@gmail.com]
>
>> Sent: Thursday, October 22, 2009 11:20 PM
>
rsday, October 22, 2009 11:20 PM
> To: java-user@lucene.apache.org
> Subject: Re: How to loop through all the entries for a field
>
>
> How do you know if your on your last term? I tried it and it does work
> but
> continues. How do you know to check if its the l
nevermind I figured it out. I did this:
while ((term = termEnum.Term()) != null)
{
if (!term.Field().Equals("BookTitle"))
break;
map = new SearchResultMap();
map.Title = term.Text
How do you know if your on your last term? I tried it and it does work but
continues. How do you know to check if its the last entry?
Thanks
Erick Erickson wrote:
>
> Try something like
> TermEnum te = IndexReader.terms(new Term("BookTitle", ""));
> do {
> Term term = te.term();
> if
Try something like
TermEnum te = IndexReader.terms(new Term("BookTitle", ""));
do {
Term term = te.term();
if (! term.field().equals("BookTitle")) break;
System.out.println(term.text());
} while (te.next());
Note that next() will merrily continue beyond the last term for
the field "Bo