public static Api.Index GetBasicIndexSettingsForContact() { var index = new Api.Index(); index.IndexName = "contact"; index.Online = true; index.Configuration.DirectoryType = Api.DirectoryType.Ram; index.Fields = new Api.FieldDictionary(); index.Fields.Add("gender", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("title", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("givenname", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); index.Fields.Add("middleinitial", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); index.Fields.Add("surname", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); index.Fields.Add("streetaddress", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); index.Fields.Add("city", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("state", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("zipcode", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("country", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("countryfull", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("emailaddress", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("username", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("password", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("cctype", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("ccnumber", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("occupation", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); index.Fields.Add("cvv2", new Api.IndexFieldProperties { FieldType = Api.FieldType.Int }); index.Fields.Add("nationalid", value: new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("ups", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("company", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); index.Fields.Add("pounds", new Api.IndexFieldProperties { FieldType = Api.FieldType.Double }); index.Fields.Add("centimeters", new Api.IndexFieldProperties { FieldType = Api.FieldType.Int }); index.Fields.Add("guid", new Api.IndexFieldProperties { FieldType = Api.FieldType.ExactText }); index.Fields.Add("latitude", new Api.IndexFieldProperties { FieldType = Api.FieldType.Double }); index.Fields.Add("longitude", new Api.IndexFieldProperties { FieldType = Api.FieldType.Double }); index.Fields.Add("importdate", new Api.IndexFieldProperties { FieldType = Api.FieldType.Date }); index.Fields.Add("timestamp", new Api.IndexFieldProperties { FieldType = Api.FieldType.DateTime }); index.Fields.Add("topic", new Api.IndexFieldProperties{FieldType = Api.FieldType.ExactText}); index.Fields.Add("abstract", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text }); // Computed fields index.Fields.Add( "fullname", new Api.IndexFieldProperties { FieldType = Api.FieldType.Text, ScriptName = "fullname" }); index.Scripts.Add( "fullname", new Api.ScriptProperties { ScriptOption = Api.ScriptOption.SingleLine, ScriptType = Api.ScriptType.ComputedField, ScriptSource = "fields[\"givenname\"] + \" \" + fields[\"surname\"]" }); return index; }
void ILogService.UpdateIndex(string indexName, Api.Index indexDetails) { UpdateIndex(indexName, JsonConvert.SerializeObject(indexDetails, JsonSerializerSettings)); }
void ILogService.IndexValidationFailed(string indexName, Api.Index indexDetails, Api.OperationMessage validationObject) { IndexValidationFailed(indexName, JsonConvert.SerializeObject(indexDetails, JsonSerializerSettings), JsonConvert.SerializeObject(validationObject, JsonSerializerSettings)); }