示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }