Skip to content

Commit

Permalink
make sure we add the _uid as the first field in a doc
Browse files Browse the repository at this point in the history
this will improve early termination loading times, but requires potential improvements in Lucene in terms of decompression
  • Loading branch information
kimchy committed Aug 7, 2013
1 parent 6c91ff8 commit c7d5881
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ public Builder(String index, @Nullable Settings indexSettings, RootObjectMapper.
idFieldMapper = new IdFieldMapper(fieldType);
}
}
// UID first so it will be the first stored field to load (so will benefit from "fields: []" early termination
this.rootMappers.put(UidFieldMapper.class, new UidFieldMapper());
this.rootMappers.put(IdFieldMapper.class, idFieldMapper);
this.rootMappers.put(RoutingFieldMapper.class, new RoutingFieldMapper());
// add default mappers, order is important (for example analyzer should come before the rest to set context.analyzer)
this.rootMappers.put(SizeFieldMapper.class, new SizeFieldMapper());
this.rootMappers.put(IndexFieldMapper.class, new IndexFieldMapper());
Expand All @@ -171,10 +174,8 @@ public Builder(String index, @Nullable Settings indexSettings, RootObjectMapper.
this.rootMappers.put(AnalyzerMapper.class, new AnalyzerMapper());
this.rootMappers.put(AllFieldMapper.class, new AllFieldMapper());
this.rootMappers.put(BoostFieldMapper.class, new BoostFieldMapper());
this.rootMappers.put(RoutingFieldMapper.class, new RoutingFieldMapper());
this.rootMappers.put(TimestampFieldMapper.class, new TimestampFieldMapper());
this.rootMappers.put(TTLFieldMapper.class, new TTLFieldMapper());
this.rootMappers.put(UidFieldMapper.class, new UidFieldMapper());
// don't add parent field, by default its "null"
}

Expand Down

0 comments on commit c7d5881

Please sign in to comment.