Exemple #1
0
        public void DeleteDocuments(string documentType, string[] documentIds,
                                    IndexingPriority priority = IndexingPriority.Default)
        {
            if (priority != IndexingPriority.NearRealTime)
            {
                ThrottleByQueueCount(priority, ThrottleQueueCount);
            }

            IndexingJobs.EnqueueDeleteDocuments(documentType, documentIds, IndexingPriorityToJobPriority(priority));
        }
Exemple #2
0
        public async Task StartStopIndexingJobs()
        {
            var scheduleJobs = await _settingsManager.GetValueAsync(ModuleConstants.Settings.IndexingJobs.Enable.Name, (bool)ModuleConstants.Settings.IndexingJobs.Enable.DefaultValue);

            if (scheduleJobs)
            {
                var cronExpression = _settingsManager.GetValue(ModuleConstants.Settings.IndexingJobs.CronExpression.Name, (string)ModuleConstants.Settings.IndexingJobs.CronExpression.DefaultValue);
                RecurringJob.AddOrUpdate <IndexingJobs>(j => j.IndexChangesJob(null, JobCancellationToken.Null), cronExpression);
            }
            else
            {
                IndexingJobs.CancelIndexation();
                RecurringJob.RemoveIfExists("IndexingJobs.IndexChangesJob");
            }
        }