Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Please follow <a href="http://lucene.apache.org/core/4_1_0/MIGRATE.html" rel="nofollow">Lucene 4 Migration guide</a>::</p> <blockquote> <p>How you obtain the enums has changed. The primary entry point is the <code>Fields</code> class. If you know your reader is a single segment reader, do this: </p> <pre><code>Fields fields = reader.Fields(); if (fields != null) { ... } </code></pre> <p>If the reader might be multi-segment, you must do this: </p> <pre><code>Fields fields = MultiFields.getFields(reader); if (fields != null) { ... } </code></pre> <p>The <code>fields</code> may be <code>null</code> (eg if the reader has no fields).</p> <p>Note that the <code>MultiFields</code> approach entails a performance hit on <code>MultiReaders</code>, as it must merge terms/docs/positions on the fly. It's generally better to instead get the sequential readers (use <code>oal.util.ReaderUtil</code>) and then step through those readers yourself, if you can (this is how Lucene drives searches).</p> <p>If you pass a <code>SegmentReader</code> to <code>MultiFields.fields</code> it will simply return <code>reader.fields()</code>, so there is no performance hit in that case.</p> <p>Once you have a non-null Fields you can do this: </p> <pre><code>Terms terms = fields.terms("field"); if (terms != null) { ... } </code></pre> <p>The <code>terms</code> may be <code>null</code> (eg if the field does not exist).</p> <p>Once you have a non-<code>null</code> terms you can get an enum like this: </p> <pre><code>TermsEnum termsEnum = terms.iterator(); </code></pre> <p>The returned <code>TermsEnum</code> will not be null.</p> <p>You can then <code>.next()</code> through the <code>TermsEnum</code></p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload