"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/java/org/apache/lucene/index/MultiFields.java" between
lucene-7.6.0-src.tgz and lucene-7.7.0-src.tgz

About: Lucene is a Java full-text search engine (not a complete application, but rather a code library and API; java source code).

MultiFields.java  (lucene-7.6.0-src.tgz):MultiFields.java  (lucene-7.7.0-src.tgz)
skipping to change at line 265 skipping to change at line 265
/** Call this to get the (merged) FieldInfos for a /** Call this to get the (merged) FieldInfos for a
* composite reader. * composite reader.
* <p> * <p>
* NOTE: the returned field numbers will likely not * NOTE: the returned field numbers will likely not
* correspond to the actual field numbers in the underlying * correspond to the actual field numbers in the underlying
* readers, and codec metadata ({@link FieldInfo#getAttribute(String)} * readers, and codec metadata ({@link FieldInfo#getAttribute(String)}
* will be unavailable. * will be unavailable.
*/ */
public static FieldInfos getMergedFieldInfos(IndexReader reader) { public static FieldInfos getMergedFieldInfos(IndexReader reader) {
final String softDeletesField = reader.leaves().stream() final List<LeafReaderContext> leaves = reader.leaves();
.map(l -> l.reader().getFieldInfos().getSoftDeletesField()) if (leaves.isEmpty()) {
.filter(Objects::nonNull).findAny().orElse(null); return FieldInfos.EMPTY;
final FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.Fie } else if (leaves.size() == 1) {
ldNumbers(softDeletesField)); return leaves.get(0).reader().getFieldInfos();
for(final LeafReaderContext ctx : reader.leaves()) { } else {
builder.add(ctx.reader().getFieldInfos()); final String softDeletesField = leaves.stream()
.map(l -> l.reader().getFieldInfos().getSoftDeletesField())
.filter(Objects::nonNull)
.findAny().orElse(null);
final FieldInfos.Builder builder = new FieldInfos.Builder(new FieldInfos.F
ieldNumbers(softDeletesField));
for (final LeafReaderContext ctx : leaves) {
builder.add(ctx.reader().getFieldInfos());
}
return builder.finish();
} }
return builder.finish();
} }
/** Call this to get the (merged) FieldInfos representing the /** Call this to get the (merged) FieldInfos representing the
* set of indexed fields <b>only</b> for a composite reader. * set of indexed fields <b>only</b> for a composite reader.
* <p> * <p>
* NOTE: the returned field numbers will likely not * NOTE: the returned field numbers will likely not
* correspond to the actual field numbers in the underlying * correspond to the actual field numbers in the underlying
* readers, and codec metadata ({@link FieldInfo#getAttribute(String)} * readers, and codec metadata ({@link FieldInfo#getAttribute(String)}
* will be unavailable. * will be unavailable.
*/ */
 End of changes. 2 change blocks. 
8 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)