Example usage for org.apache.lucene.codecs.perfield PerFieldDocValuesFormat getDocValuesFormatForField

List of usage examples for org.apache.lucene.codecs.perfield PerFieldDocValuesFormat getDocValuesFormatForField

Introduction

In this page you can find the example usage for org.apache.lucene.codecs.perfield PerFieldDocValuesFormat getDocValuesFormatForField.

Prototype

public abstract DocValuesFormat getDocValuesFormatForField(String field);

Source Link

Document

Returns the doc values format that should be used for writing new segments of field.

Usage

From source file:org.apache.solr.core.TestCodecSupport.java

License:Apache License

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("Disk", format.getDocValuesFormatForField(schemaField.getName()).getName());
    schemaField = fields.get("string_memory_f");
    assertEquals("Lucene45", format.getDocValuesFormatForField(schemaField.getName()).getName());
    schemaField = fields.get("string_f");
    assertEquals("Lucene45", format.getDocValuesFormatForField(schemaField.getName()).getName());
}

From source file:org.apache.solr.core.TestCodecSupport.java

License:Apache License

public void testDynamicFieldsDocValuesFormats() {
    Codec codec = h.getCore().getCodec();
    PerFieldDocValuesFormat format = (PerFieldDocValuesFormat) codec.docValuesFormat();

    assertEquals("Disk", format.getDocValuesFormatForField("foo_disk").getName());
    assertEquals("Disk", format.getDocValuesFormatForField("bar_disk").getName());
    assertEquals("Lucene45", format.getDocValuesFormatForField("foo_memory").getName());
    assertEquals("Lucene45", format.getDocValuesFormatForField("bar_memory").getName());
}