>From IndexReader API javadoc:

 <p>There are two different types of IndexReaders:
 <ul>
  <li>{@link AtomicReader}: These indexes do not consist of several sub-readers,
  they are atomic. They support retrieval of stored fields, doc values, terms,
  and postings.
  <li>{@link CompositeReader}: Instances (like {@link DirectoryReader})
  of this reader can only
  be used to get stored fields from the underlying AtomicReaders,
  but it is not possible to directly retrieve postings. To do that, get
  the sub-readers via {@link CompositeReader#getSequentialSubReaders}.
  Alternatively, you can mimic an {@link AtomicReader} (with a serious
slowdown),
  by wrapping composite readers with {@link SlowCompositeReaderWrapper}.
 </ul>

You need to get an AtomicReader somehow (or wrap with a
SlowCompositeReaderWrapper).

D.

On Sun, Feb 17, 2013 at 11:30 AM, Sebastiano Vigna <[email protected]> wrote:
> On 16 February 2013 14:35, Robert Muir <[email protected]> wrote:
>>
>>
>>       TermsEnum termsEnum = reader.terms("body").iterator(null);
>>       boolean found = termsEnum.seekExact(new BytesRef("dogs"), false);
>>       // pass 0, to not ask for frequencies
>>       DocsEnum docsEnum = termsEnum.docs(reader.getLiveDocs(), null, 0);
>
>
> I'm painstakingly chasing  through the API, but IndexReader (I had to guess
> the class you meant for "reader") does not have a terms() method. Only the
> Fields class. Could you please expand the first line in something that
> compiles? Thanks!
>
> seba

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to