if (defaultCodecSupportsSortedSet()) {
doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("one")));
doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
}
if (defaultCodecSupportsSortedNumeric()) {
doc.add(new SortedNumericDocValuesField("sortednumericdv", 4));
doc.add(new SortedNumericDocValuesField("sortednumericdv", 3));
}
w.addDocument(doc);
doc = new Document();
doc.add(newStringField(random, "id", "501", Field.Store.NO));
doc.add(newField(random, "field", "some more contents", storedTextType));
if (defaultCodecSupportsDocValues()) {
doc.add(new BinaryDocValuesField("binarydv", new BytesRef("501")));
doc.add(new NumericDocValuesField("numericdv", 501));
doc.add(new SortedDocValuesField("sorteddv", new BytesRef("501")));
}
if (defaultCodecSupportsSortedSet()) {
doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("two")));
doc.add(new SortedSetDocValuesField("sortedsetdv", new BytesRef("three")));
}
if (defaultCodecSupportsSortedNumeric()) {
doc.add(new SortedNumericDocValuesField("sortednumericdv", 6));
doc.add(new SortedNumericDocValuesField("sortednumericdv", 1));
}
w.addDocument(doc);
w.deleteDocuments(new Term("id", "500"));
w.close();
}