Beispiel #1
0
        public string FullText(
            SiteSettings ss, bool backgroundTask = false, bool onCreating = false)
        {
            if (Parameters.Search.Provider != "FullText")
            {
                return(null);
            }
            if (!Parameters.Search.CreateIndexes && !backgroundTask)
            {
                return(null);
            }
            if (AccessStatus == Databases.AccessStatuses.NotFound)
            {
                return(null);
            }
            var fullText = new List <string>();

            SiteInfo.TenantCaches[Sessions.TenantId()]
            .SiteMenu.Breadcrumb(SiteId).FullText(fullText);
            SiteId.FullText(fullText);
            ss.EditorColumns.ForEach(columnName =>
            {
                switch (columnName)
                {
                case "WikiId":
                    WikiId.FullText(fullText);
                    break;

                case "Title":
                    Title.FullText(fullText);
                    break;

                case "Body":
                    Body.FullText(fullText);
                    break;

                case "Comments":
                    Comments.FullText(fullText);
                    break;
                }
            });
            Creator.FullText(fullText);
            Updator.FullText(fullText);
            CreatedTime.FullText(fullText);
            UpdatedTime.FullText(fullText);
            if (!onCreating)
            {
                FullTextExtensions.OutgoingMailsFullText(fullText, "Wikis", WikiId);
            }
            return(fullText
                   .Where(o => !o.IsNullOrEmpty())
                   .Select(o => o.Trim())
                   .Distinct()
                   .Join(" "));
        }