Inheritance: AbstractSearchFieldConfiguration
        public static AzureField CreateField(string name, object value, AzureSearchFieldConfiguration fieldConfiguration, IIndexFieldStorageValueFormatter indexFieldStorageValueFormatter)
        {
            if (value == null)
            {
                VerboseLogging.CrawlingLogDebug((Func<string>)(() => string.Format("Skipping field {0} - value null", (object)name)));
                return null;
            }
            if (fieldConfiguration == null)
                throw new ArgumentNullException("fieldConfiguration");
            if (VerboseLogging.Enabled)
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.AppendFormat("Field: {0}" + Environment.NewLine, name);
                stringBuilder.AppendFormat(" - value: {0}" + Environment.NewLine, value.GetType());
                stringBuilder.AppendFormat(" - value: {0}" + Environment.NewLine, value);
                //stringBuilder.AppendFormat(" - fieldConfiguration analyzer: {0}" + Environment.NewLine, fieldConfiguration.Analyzer != null ? (object)fieldConfiguration.Analyzer.GetType().ToString() : (object)"NULL");
                stringBuilder.AppendFormat(" - fieldConfiguration boost: {0}" + Environment.NewLine, fieldConfiguration.Boost);
                stringBuilder.AppendFormat(" - fieldConfiguration fieldID: {0}" + Environment.NewLine, fieldConfiguration.FieldID);
                stringBuilder.AppendFormat(" - fieldConfiguration FieldName: {0}" + Environment.NewLine, fieldConfiguration.FieldName);
                stringBuilder.AppendFormat(" - fieldConfiguration FieldTypeName: {0}" + Environment.NewLine, fieldConfiguration.FieldTypeName);
                //stringBuilder.AppendFormat(" - fieldConfiguration IndexType: {0}" + Environment.NewLine, (object)fieldConfiguration.IndexType);
                //stringBuilder.AppendFormat(" - fieldConfiguration StorageType: {0}" + Environment.NewLine, (object)fieldConfiguration.StorageType);
                //stringBuilder.AppendFormat(" - fieldConfiguration VectorType: {0}" + Environment.NewLine, (object)fieldConfiguration.VectorType);
                stringBuilder.AppendFormat(" - fieldConfiguration Type: {0}" + Environment.NewLine, fieldConfiguration.Type);
                VerboseLogging.CrawlingLogDebug(new Func<string>(((object)stringBuilder).ToString));
            }

            return new AzureField(name, value, BuildField(name, fieldConfiguration), fieldConfiguration.Type);
        }
        public static AzureField CreateField(string name, object value, AzureSearchFieldConfiguration fieldConfiguration, IIndexFieldStorageValueFormatter indexFieldStorageValueFormatter)
        {
            if (value == null)
            {
                VerboseLogging.CrawlingLogDebug((Func <string>)(() => string.Format("Skipping field {0} - value null", (object)name)));
                return(null);
            }
            if (fieldConfiguration == null)
            {
                throw new ArgumentNullException("fieldConfiguration");
            }
            if (VerboseLogging.Enabled)
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.AppendFormat("Field: {0}" + Environment.NewLine, name);
                stringBuilder.AppendFormat(" - value: {0}" + Environment.NewLine, value.GetType());
                stringBuilder.AppendFormat(" - value: {0}" + Environment.NewLine, value);
                //stringBuilder.AppendFormat(" - fieldConfiguration analyzer: {0}" + Environment.NewLine, fieldConfiguration.Analyzer != null ? (object)fieldConfiguration.Analyzer.GetType().ToString() : (object)"NULL");
                stringBuilder.AppendFormat(" - fieldConfiguration boost: {0}" + Environment.NewLine, fieldConfiguration.Boost);
                stringBuilder.AppendFormat(" - fieldConfiguration fieldID: {0}" + Environment.NewLine, fieldConfiguration.FieldID);
                stringBuilder.AppendFormat(" - fieldConfiguration FieldName: {0}" + Environment.NewLine, fieldConfiguration.FieldName);
                stringBuilder.AppendFormat(" - fieldConfiguration FieldTypeName: {0}" + Environment.NewLine, fieldConfiguration.FieldTypeName);
                //stringBuilder.AppendFormat(" - fieldConfiguration IndexType: {0}" + Environment.NewLine, (object)fieldConfiguration.IndexType);
                //stringBuilder.AppendFormat(" - fieldConfiguration StorageType: {0}" + Environment.NewLine, (object)fieldConfiguration.StorageType);
                //stringBuilder.AppendFormat(" - fieldConfiguration VectorType: {0}" + Environment.NewLine, (object)fieldConfiguration.VectorType);
                stringBuilder.AppendFormat(" - fieldConfiguration Type: {0}" + Environment.NewLine, fieldConfiguration.Type);
                VerboseLogging.CrawlingLogDebug(new Func <string>(((object)stringBuilder).ToString));
            }

            return(new AzureField(name, value, BuildField(name, fieldConfiguration), fieldConfiguration.Type));
        }
        private void AddComputedIndexField(IComputedIndexField computedIndexField, object fieldValue)
        {
            AzureSearchFieldConfiguration fieldSettings = this.Index.Configuration.FieldMap.GetFieldConfiguration(computedIndexField.FieldName) as AzureSearchFieldConfiguration;

            if (fieldValue is IEnumerable && !(fieldValue is string))
            {
                foreach (object fieldValue1 in fieldValue as IEnumerable)
                {
                    if (fieldSettings != null)
                    {
                        this.AddField(computedIndexField.FieldName, fieldValue1, fieldSettings, 0.0f);
                    }
                    else
                    {
                        this.AddField(computedIndexField.FieldName, fieldValue1, false);
                    }
                }
            }
            else if (fieldSettings != null)
            {
                this.AddField(computedIndexField.FieldName, fieldValue, fieldSettings, 0.0f);
            }
            else
            {
                this.AddField(computedIndexField.FieldName, fieldValue, false);
            }
        }
        protected void AddField(string name, object value, AzureSearchFieldConfiguration fieldSettings, float boost = 0.0f)
        {
            Assert.IsNotNull((object)fieldSettings, "fieldSettings");
            name   = this.Index.FieldNameTranslator.GetIndexFieldName(name);
            boost += fieldSettings.Boost;
            IEnumerable enumerable = value as IEnumerable;

            if (enumerable != null && !(value is string))
            {
                foreach (object valueToIndex in enumerable)
                {
                    object obj   = fieldSettings.FormatForWriting(valueToIndex);
                    var    field = AzureFieldBuilder.CreateField(name, obj, fieldSettings, this.Index.Configuration.IndexFieldStorageValueFormatter);
                    if (field != null)
                    {
                        field.Boost = boost;
                        this.fields.Enqueue(field);
                    }
                }
            }
            else
            {
                value = fieldSettings.FormatForWriting(value);
                var field = AzureFieldBuilder.CreateField(name, value, fieldSettings, this.Index.Configuration.IndexFieldStorageValueFormatter);
                if (field == null)
                {
                    return;
                }

                field.Boost = boost;
                this.fields.Enqueue(field);
            }
        }
 private static Field BuildField(string name, AzureSearchFieldConfiguration fieldConfiguration)
 {
     var fld = new Field();
     fieldConfiguration.SetValues();
     fld.IsFacetable = fieldConfiguration.IsFacetable;
     fld.IsFilterable = fieldConfiguration.IsFilterable;
     fld.IsKey = fieldConfiguration.IsKey;
     fld.IsRetrievable = fieldConfiguration.IsRetrievable;
     fld.IsSearchable = fieldConfiguration.IsSearchable;
     fld.IsSortable = fieldConfiguration.IsSortable;
     fld.Name = name;
     fld.Type = fieldConfiguration.Type ?? DataType.String;
     return fld;
 }
        private static Field BuildField(string name, AzureSearchFieldConfiguration fieldConfiguration)
        {
            var fld = new Field();

            fieldConfiguration.SetValues();
            fld.IsFacetable   = fieldConfiguration.IsFacetable;
            fld.IsFilterable  = fieldConfiguration.IsFilterable;
            fld.IsKey         = fieldConfiguration.IsKey;
            fld.IsRetrievable = fieldConfiguration.IsRetrievable;
            fld.IsSearchable  = fieldConfiguration.IsSearchable;
            fld.IsSortable    = fieldConfiguration.IsSortable;
            fld.Name          = name;
            fld.Type          = fieldConfiguration.Type ?? DataType.String;
            return(fld);
        }
        public override void AddField(IIndexableDataField field)
        {
            var fieldConfiguration1 = this.Context.Index.Configuration.FieldMap.GetFieldConfiguration(field);
            var fieldValue          = this.Index.Configuration.FieldReaders.GetFieldValue(field);
            var name = field.Name;
            AzureSearchFieldConfiguration fieldSettings = this.Index.Configuration.FieldMap.GetFieldConfiguration(field) as AzureSearchFieldConfiguration;

            if (fieldSettings == null)
            {
                VerboseLogging.CrawlingLogDebug((Func <string>)(() => string.Format("Cannot resolve field settings for field id:{0}, name:{1}, typeKey:{2} - The field will not be added to the index.", field.Id, (object)field.Name, (object)field.TypeKey)));
            }
            else
            {
                var obj   = fieldConfiguration1.FormatForWriting(fieldValue);
                var boost = BoostingManager.ResolveFieldBoosting(field);
                if (IndexOperationsHelper.IsTextField(field))
                {
                    var fieldConfiguration2 = this.Index.Configuration.FieldMap.GetFieldConfiguration("s_content") as AzureSearchFieldConfiguration;
                    this.AddField("s_content", obj, fieldConfiguration2 ?? this.defaultTextField, 0.0f);
                }
                this.AddField(name, obj, fieldSettings, boost);
            }
        }