Store mergeable field from cache in index

Eventually this will no longer be part of the serialized change proto,
and even with the cache it is still expensive to check mergeability
for each change in a list of search results, as the submit type must
still be checked in order to look up the mergeability.

The new MERGEABLE field now loads from the cache, although ChangeJson
and several other callers still depend on the field in Change. This
will facilitate index schema upgrades, in that a full reindex will
also populate the persistent cache.

While we're at it, upgrade Lucene to 4.10.1, which contains some
important stability bugfixes[1].

[1] http://lucene.apache.org/core/4_10_1/changes/Changes.html#v4.10.1

Change-Id: I166b85f91bd596a3f0295616c2e72853b692dd54
This commit is contained in:
Dave Borowitz
2014-10-17 14:51:03 -07:00
parent 094ee4daa1
commit 2ab1af186e
14 changed files with 228 additions and 89 deletions

View File

@@ -441,13 +441,25 @@ public class ChangeField {
};
/** Whether the change is mergeable. */
public static final FieldDef<ChangeData, String> MERGEABLE =
@Deprecated
public static final FieldDef<ChangeData, String> LEGACY_MERGEABLE =
new FieldDef.Single<ChangeData, String>(
ChangeQueryBuilder.FIELD_MERGEABLE, FieldType.EXACT, false) {
@Override
public String get(ChangeData input, FillArgs args)
throws OrmException {
return input.change().isMergeable() ? "1" : null;
return input.isMergeable() ? "1" : null;
}
};
/** Whether the change is mergeable. */
public static final FieldDef<ChangeData, String> MERGEABLE =
new FieldDef.Single<ChangeData, String>(
"mergeable2", FieldType.EXACT, true) {
@Override
public String get(ChangeData input, FillArgs args)
throws OrmException {
return input.isMergeable() ? "1" : "0";
}
};