lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: TermDocs
Date Tue, 09 Jul 2013 07:16:01 GMT
Hi,

> I don't find an elegant solution.  reader.termDocs(null) returns AllTermDocs
> which doesn't exist in lucene 4.3.
> 
> 
> I use this piece of code
> 
>     Bits liveDocs = reader.getLiveDocs();
>     for (int i = 0; i < reader.maxDoc(); ++i) {
>       if (liveDocs != null && !liveDocs.get(i)) {
>         continue;
>       }

This is what termDocs(null) did internally in Lucene 3. So this code "looks" not efficient
but that is all you can do - and is not different than in earlier Lucene versions.

Uwe

> 2013/7/8 Ian Lea <ian.lea@gmail.com>
> 
> > There's a fair chunk of info on TermDocs and friends in the migration
> > guide. http://lucene.apache.org/core/4_3_1/MIGRATE.html
> >
> > Does that cover your question?
> >
> >
> > --
> > Ian.
> >
> >
> > On Mon, Jul 8, 2013 at 12:32 PM, Yonghui Zhao <zhaoyonghui@gmail.com>
> > wrote:
> > > Hi,
> > >
> > > What's proper replacement of "TermDocs termDocs =
> > > reader.termDocs(null);“ in lucene 4.x It seems
> > > reader.termDocsEnum(term) can't take null as a input parameter.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >


---------------------------------------------------------------------
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