FieldType: Remove unnecessary KEYWORD type

Elasticsearch 5 split string type in two: keyword (also known as exact
in gerrit index type system) and text (also known as full text in gerrit
index type system).  During migration from Elasticsearch 2 to 5 exact
type was erroneously split in exact and keyword types, that are the same.

This reverts commit 506125e71a.
This reverts commit 09fdc3eaad.

Change-Id: I788e4d06d490687508c4bfd1703037a268fe31a5
This commit is contained in:
David Ostrovsky
2018-06-05 20:38:34 +02:00
committed by David Pursehouse
parent 852e5ac7ac
commit 0f6c9bd34c
8 changed files with 12 additions and 32 deletions

View File

@@ -39,10 +39,6 @@ public final class FieldDef<I, T> {
return new FieldDef.Builder<>(FieldType.EXACT, name);
}
public static FieldDef.Builder<String> keyword(String name) {
return new FieldDef.Builder<>(FieldType.KEYWORD, name);
}
public static FieldDef.Builder<String> fullText(String name) {
return new FieldDef.Builder<>(FieldType.FULL_TEXT, name);
}

View File

@@ -33,9 +33,6 @@ public class FieldType<T> {
/** A string field searched using exact-match semantics. */
public static final FieldType<String> EXACT = new FieldType<>("EXACT");
/** A Keyword field searched using non-analyzed-match semantics. */
public static final FieldType<String> KEYWORD = new FieldType<>("KEYWORD");
/** A string field searched using prefix. */
public static final FieldType<String> PREFIX = new FieldType<>("PREFIX");

View File

@@ -17,7 +17,6 @@ package com.google.gerrit.server.index.group;
import static com.google.gerrit.server.index.FieldDef.exact;
import static com.google.gerrit.server.index.FieldDef.fullText;
import static com.google.gerrit.server.index.FieldDef.integer;
import static com.google.gerrit.server.index.FieldDef.keyword;
import static com.google.gerrit.server.index.FieldDef.prefix;
import com.google.gerrit.reviewdb.client.AccountGroup;
@@ -32,11 +31,11 @@ public class GroupField {
/** Group UUID. */
public static final FieldDef<AccountGroup, String> UUID =
keyword("uuid").stored().build(g -> g.getGroupUUID().get());
exact("uuid").stored().build(g -> g.getGroupUUID().get());
/** Group owner UUID. */
public static final FieldDef<AccountGroup, String> OWNER_UUID =
keyword("owner_uuid").build(g -> g.getOwnerGroupUUID().get());
exact("owner_uuid").build(g -> g.getOwnerGroupUUID().get());
/** Group name. */
public static final FieldDef<AccountGroup, String> NAME =