Lucene: Search commit messages using secondary index
Change-Id: Iff2285d0b4934e9871e7635ae3681555f06ea336
This commit is contained in:

committed by
Edwin Kempin

parent
a7c0ba2b50
commit
122ecd55fc
@@ -27,6 +27,7 @@ import com.google.gerrit.server.query.change.ChangeQueryBuilder;
|
||||
import com.google.gerrit.server.query.change.ChangeStatusPredicate;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
@@ -46,7 +47,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeField {
|
||||
/** Increment whenever making schema changes. */
|
||||
public static final int SCHEMA_VERSION = 11;
|
||||
public static final int SCHEMA_VERSION = 12;
|
||||
|
||||
/** Legacy change ID. */
|
||||
public static final FieldDef<ChangeData, Integer> LEGACY_ID =
|
||||
@@ -234,6 +235,20 @@ public class ChangeField {
|
||||
+ (accountId != null ? "," + accountId.get() : "");
|
||||
}
|
||||
|
||||
/** Commit message of the current patch set. */
|
||||
public static final FieldDef<ChangeData, String> COMMIT_MESSAGE =
|
||||
new FieldDef.Single<ChangeData, String>(ChangeQueryBuilder.FIELD_MESSAGE,
|
||||
FieldType.FULL_TEXT, false) {
|
||||
@Override
|
||||
public String get(ChangeData input, FillArgs args) throws OrmException {
|
||||
try {
|
||||
return input.commitMessage(args.repoManager, args.db);
|
||||
} catch (IOException e) {
|
||||
throw new OrmException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static final ImmutableMap<String, FieldDef<ChangeData, ?>> ALL;
|
||||
|
||||
static {
|
||||
|
Reference in New Issue
Block a user