ScrewTurn.Wiki.PagesStorageProvider.UnindexMessage C# (CSharp) Method

UnindexMessage() private method

Removes a message from the search engine index.
private UnindexMessage ( System.PageInfo page, int id, string subject, System.DateTime dateTime, string body ) : void
page System.PageInfo The page.
id int The message ID.
subject string The subject.
dateTime System.DateTime The date/time.
body string The body.
return void
        private void UnindexMessage(PageInfo page, int id, string subject, DateTime dateTime, string body)
        {
            lock(this) {
                // Trim "RE:" to avoid polluting the search engine index
                if(subject.ToLowerInvariant().StartsWith("re:") && subject.Length > 3) subject = subject.Substring(3).Trim();

                string documentName = MessageDocument.GetDocumentName(page, id);

                DumpedDocument ddoc = new DumpedDocument(0, documentName, host.PrepareTitleForIndexing(null, subject),
                    MessageDocument.StandardTypeTag, DateTime.Now);
                index.RemoveDocument(new MessageDocument(page, id, ddoc, TokenizeContent), null);
            }
        }
PagesStorageProvider