Beispiel #1
0
        public void Delete(params THeader[] docHeaders)
        {
            foreach (var docHeader in docHeaders)
            {
                var storageKey = EntityAdapter.GetStorageKey(docHeader);
                Log.DebugFormat("Deleting {0}#{1}", docHeader.Name, storageKey);
                Storage.Delete(storageKey);
            }

            FulltextBackgroundTaskExecutor.Schedule(() =>
            {
                SearchEngine.Delete(docHeaders);
                SearchEngine.CommitFulltextIndex();
            });
        }
Beispiel #2
0
        public TDoc Delete(TKey id)
        {
            var result = Storage.Delete(id);

            FulltextBackgroundTaskExecutor.Schedule(() =>
            {
                if (EntityAdapter.CanConvertStorageKey)
                {
                    SearchEngine.Delete(EntityAdapter.GetFulltextFromStorageKey(id));
                }
                else if (result != null)
                {
                    SearchEngine.Delete(EntityAdapter.GetFulltextKey(result));
                }

                if (EntityAdapter.CanConvertStorageKey || result != null)
                {
                    SearchEngine.CommitFulltextIndex();
                }
            });

            return(result);
        }