public void OnDefinitionsBuilt(Building.BuildingContext context, DomainModelDef model) { var documentDef = model.Types[typeof(noFTModel.Document)]; var title = documentDef.Fields["Title"]; var documentBody = documentDef.Fields["DocumentBody"]; var titleIndex = documentDef.Fields.IndexOf(title); var documentBodyIndex = documentDef.Fields.IndexOf(documentBody); var oldFieldsMap = documentDef.Fields.ToArray(); documentDef.Fields.Clear(); oldFieldsMap[titleIndex] = documentBody; oldFieldsMap[documentBodyIndex] = title; foreach (var fieldDef in oldFieldsMap) { documentDef.Fields.Add(fieldDef); } var ftIndexDef = new FullTextIndexDef(documentDef); ftIndexDef.Fields.Add( new FullTextFieldDef("DocumentBody", false) { Configuration = "English", TypeFieldName = "Extension" }); ftIndexDef.Fields.Add(new FullTextFieldDef("Title", false) { Configuration = "English" }); model.FullTextIndexes.Add(ftIndexDef); }
public void OnDefinitionsBuilt(Building.BuildingContext context, Building.Definitions.DomainModelDef model) { var documentDef = model.Types[typeof(noFTModel.Document)]; var ftIndexDef = new FullTextIndexDef(documentDef); ftIndexDef.Fields.Add(new FullTextFieldDef("Title", false) { Configuration = "English" }); model.FullTextIndexes.Add(ftIndexDef); }
public void OnDefinitionsBuilt(Building.BuildingContext context, DomainModelDef model) { var documentDef = model.Types[typeof(noFTModel.Document)]; var realExtensionField = documentDef.DefineField("RealExtension", typeof(string)); realExtensionField.Length = 50; var ftIndexDef = new FullTextIndexDef(documentDef); ftIndexDef.Fields.Add( new FullTextFieldDef("DocumentBody", false) { Configuration = "English", TypeFieldName = "RealExtension" }); model.FullTextIndexes.Add(ftIndexDef); }