Search in sources :

Example 1 with PerFieldDocValuesFormat

use of org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat in project lucene-solr by apache.

the class TestCodecSupport method testDynamicFieldsDocValuesFormats.

public void testDynamicFieldsDocValuesFormats() {
    Codec codec = h.getCore().getCodec();
    PerFieldDocValuesFormat format = (PerFieldDocValuesFormat) codec.docValuesFormat();
    assertEquals(TestUtil.getDefaultDocValuesFormat().getName(), format.getDocValuesFormatForField("foo_disk").getName());
    assertEquals(TestUtil.getDefaultDocValuesFormat().getName(), format.getDocValuesFormatForField("bar_disk").getName());
    assertEquals("Memory", format.getDocValuesFormatForField("foo_memory").getName());
    assertEquals("Memory", format.getDocValuesFormatForField("bar_memory").getName());
}
Also used : Codec(org.apache.lucene.codecs.Codec) PerFieldDocValuesFormat(org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat)

Example 2 with PerFieldDocValuesFormat

use of org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat in project lucene-solr by apache.

the class TestCodecSupport method testDocValuesFormats.

public void testDocValuesFormats() {
    Codec codec = h.getCore().getCodec();
    Map<String, SchemaField> fields = h.getCore().getLatestSchema().getFields();
    SchemaField schemaField = fields.get("string_disk_f");
    PerFieldDocValuesFormat format = (PerFieldDocValuesFormat) codec.docValuesFormat();
    assertEquals(TestUtil.getDefaultDocValuesFormat().getName(), format.getDocValuesFormatForField(schemaField.getName()).getName());
    schemaField = fields.get("string_memory_f");
    assertEquals("Memory", format.getDocValuesFormatForField(schemaField.getName()).getName());
    schemaField = fields.get("string_f");
    assertEquals(TestUtil.getDefaultDocValuesFormat().getName(), format.getDocValuesFormatForField(schemaField.getName()).getName());
}
Also used : SchemaField(org.apache.solr.schema.SchemaField) Codec(org.apache.lucene.codecs.Codec) PerFieldDocValuesFormat(org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat)

Aggregations

Codec (org.apache.lucene.codecs.Codec)2 PerFieldDocValuesFormat (org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat)2 SchemaField (org.apache.solr.schema.SchemaField)1