pub fn from_schema(schema: &Schema) -> FastFieldsWriter {
        let mut single_value_writers = Vec::new();
        let mut multi_values_writers = Vec::new();
        let mut bytes_value_writers = Vec::new();

        for (field, field_entry) in schema.fields() {
            match *field_entry.field_type() {
                FieldType::I64(ref int_options)
                | FieldType::U64(ref int_options)
                | FieldType::F64(ref int_options)
                | FieldType::Date(ref int_options) => {
                    match int_options.get_fastfield_cardinality() {
                        Some(Cardinality::SingleValue) => {
                            let mut fast_field_writer = IntFastFieldWriter::new(field);
                            let default_value = fast_field_default_value(field_entry);
                            fast_field_writer.set_val_if_missing(default_value);
                            single_value_writers.push(fast_field_writer);
                        }
                        Some(Cardinality::MultiValues) => {
                            let fast_field_writer = MultiValueIntFastFieldWriter::new(field, false);
                            multi_values_writers.push(fast_field_writer);
                        }
                        None => {}
                    }
                }
                FieldType::HierarchicalFacet => {
                    let fast_field_writer = MultiValueIntFastFieldWriter::new(field, true);
                    multi_values_writers.push(fast_field_writer);
                }
                FieldType::Bytes => {
                    let fast_field_writer = BytesFastFieldWriter::new(field);
                    bytes_value_writers.push(fast_field_writer);
                }
                _ => {}
            }
        }
        FastFieldsWriter {
            single_value_writers,
            multi_values_writers,
            bytes_value_writers,
        }
    }
/// Create all `FastFieldWriter` required by the schema.
Create all `FastFieldWriter` required by the schema.
Create all ` FastFieldWriter ` required by the schema .
pub fn from_schema(schema: &Schema) -> FastFieldsWriter {
        let mut single_value_writers = Vec::new();
        let mut multi_values_writers = Vec::new();
        let mut bytes_value_writers = Vec::new();
        for (field, field_entry) in schema.fields() {
            match *field_entry.field_type() {
                FieldType::I64(ref int_options)
                | FieldType::U64(ref int_options)
                | FieldType::F64(ref int_options)
                | FieldType::Date(ref int_options) => {
                    match int_options.get_fastfield_cardinality() {
                        Some(Cardinality::SingleValue) => {
                            let mut fast_field_writer = IntFastFieldWriter::new(field);
                            let default_value = fast_field_default_value(field_entry);
                            fast_field_writer.set_val_if_missing(default_value);
                            single_value_writers.push(fast_field_writer);
                        }
                        Some(Cardinality::MultiValues) => {
                            let fast_field_writer = MultiValueIntFastFieldWriter::new(field, false);
                            multi_values_writers.push(fast_field_writer);
                        }
                        None => {}
                    }
                }
                FieldType::HierarchicalFacet => {
                    let fast_field_writer = MultiValueIntFastFieldWriter::new(field, true);
                    multi_values_writers.push(fast_field_writer);
                }
                FieldType::Bytes => {
                    let fast_field_writer = BytesFastFieldWriter::new(field);
                    bytes_value_writers.push(fast_field_writer);
                }
                _ => {}
            }
        }
        FastFieldsWriter {
            single_value_writers,
            multi_values_writers,
            bytes_value_writers,
        }
    }
pub fn from_schema ( schema : & Schema ) -> FastFieldsWriter { let mut single_value_writers = Vec :: new ( ) ; let mut multi_values_writers = Vec :: new ( ) ; let mut bytes_value_writers = Vec :: new ( ) ; for ( field , field_entry ) in schema . fields ( ) { match * field_entry . field_type ( ) { FieldType :: I64 ( ref int_options ) | FieldType :: U64 ( ref int_options ) | FieldType :: F64 ( ref int_options ) | FieldType :: Date ( ref int_options ) => { match int_options . get_fastfield_cardinality ( ) { Some ( Cardinality :: SingleValue ) => { let mut fast_field_writer = IntFastFieldWriter :: new ( field ) ; let default_value = fast_field_default_value ( field_entry ) ; fast_field_writer . set_val_if_missing ( default_value ) ; single_value_writers . push ( fast_field_writer ) ; } Some ( Cardinality :: MultiValues ) => { let fast_field_writer = MultiValueIntFastFieldWriter :: new ( field , false ) ; multi_values_writers . push ( fast_field_writer ) ; } None => { } } } FieldType :: HierarchicalFacet => { let fast_field_writer = MultiValueIntFastFieldWriter :: new ( field , true ) ; multi_values_writers . push ( fast_field_writer ) ; } FieldType :: Bytes => { let fast_field_writer = BytesFastFieldWriter :: new ( field ) ; bytes_value_writers . push ( fast_field_writer ) ; } _ => { } } } FastFieldsWriter { single_value_writers , multi_values_writers , bytes_value_writers , } }
Create all `FastFieldWriter` required by the schema.
Create all ` FastFieldWriter ` required by the schema .
schema
&Schema
schema
&Schema