Skip to content

Commit b47d81d

Browse files
committed
Replace remaining references to 'json' with 'flattened'
We missed these when renaming the flattened field type.
1 parent a0532c6 commit b47d81d

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

server/src/main/java/org/elasticsearch/index/mapper/flattened/KeyedFlattenedLeafFieldData.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public SortedSetDocValues getOrdinalsValues() {
7070
throw new UncheckedIOException(e);
7171
}
7272

73-
return new KeyedJsonDocValues(keyBytes, values, minOrd, maxOrd);
73+
return new KeyedFlattenedDocValues(keyBytes, values, minOrd, maxOrd);
7474
}
7575

7676
@Override
@@ -144,7 +144,7 @@ private static int compare(BytesRef key, BytesRef term) {
144144
return key.compareTo(extractedKey);
145145
}
146146

147-
private static class KeyedJsonDocValues extends AbstractSortedSetDocValues {
147+
private static class KeyedFlattenedDocValues extends AbstractSortedSetDocValues {
148148

149149
private final BytesRef key;
150150
private final SortedSetDocValues delegate;
@@ -163,10 +163,10 @@ private static class KeyedJsonDocValues extends AbstractSortedSetDocValues {
163163
*/
164164
private long cachedNextOrd;
165165

166-
private KeyedJsonDocValues(BytesRef key,
167-
SortedSetDocValues delegate,
168-
long minOrd,
169-
long maxOrd) {
166+
private KeyedFlattenedDocValues(BytesRef key,
167+
SortedSetDocValues delegate,
168+
long minOrd,
169+
long maxOrd) {
170170
assert minOrd >= 0 && maxOrd >= 0;
171171
this.key = key;
172172
this.delegate = delegate;

server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParserTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.elasticsearch.common.xcontent.json.JsonXContent;
1919
import org.elasticsearch.index.mapper.MappedFieldType;
2020
import org.elasticsearch.index.mapper.MockFieldMapper.FakeFieldType;
21-
import org.elasticsearch.index.mapper.flattened.FlattenedFieldParser;
2221
import org.elasticsearch.test.ESTestCase;
2322
import org.elasticsearch.test.XContentTestUtils;
2423
import org.junit.Before;

server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedIndexFieldDataTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void testGlobalFieldDataCaching() throws IOException {
4545
indicesService.getCircuitBreakerService(),
4646
indexService.mapperService());
4747

48-
FlattenedFieldMapper fieldMapper = new FlattenedFieldMapper.Builder("json").build(new ContentPath(1));
48+
FlattenedFieldMapper fieldMapper = new FlattenedFieldMapper.Builder("flattened").build(new ContentPath(1));
4949
MappedFieldType fieldType1 = fieldMapper.fieldType().getChildFieldType("key");
5050

5151
AtomicInteger onCacheCalled = new AtomicInteger();
@@ -63,7 +63,7 @@ public void onCache(ShardId shardId, String fieldName, Accountable ramUsage) {
6363
IndexWriter writer = new IndexWriter(directory, config);
6464

6565
Document doc = new Document();
66-
doc.add(new SortedSetDocValuesField("json._keyed", new BytesRef("some_key\0some_value")));
66+
doc.add(new SortedSetDocValuesField("flattened._keyed", new BytesRef("some_key\0some_value")));
6767
writer.addDocument(doc);
6868
writer.commit();
6969
writer.addDocument(doc);

server/src/test/java/org/elasticsearch/search/lookup/LeafDocLookupTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ public void testFlattenedField() {
7373
};
7474

7575
LeafDocLookup docLookup = new LeafDocLookup(field -> {
76-
if (field.equals("json.key1")) {
76+
if (field.equals("flattened.key1")) {
7777
return fieldType1;
7878
}
79-
if (field.equals("json.key2")) {
79+
if (field.equals("flattened.key2")) {
8080
return fieldType2;
8181
}
8282
return null;
8383
}, fieldDataSupplier, null);
8484

85-
assertEquals(docValues1, docLookup.get("json.key1"));
86-
assertEquals(docValues2, docLookup.get("json.key2"));
85+
assertEquals(docValues1, docLookup.get("flattened.key1"));
86+
assertEquals(docValues2, docLookup.get("flattened.key2"));
8787
}
8888

8989
private IndexFieldData<?> createFieldData(ScriptDocValues<?> scriptDocValues) {

0 commit comments

Comments
 (0)