Beispiel #1
0
        public ActionResult ReIndexItems()
        {
            if (!ExamineManager.Instance.TryGetIndex("Simple2Indexer", out var index))
            {
                return(HttpNotFound());
            }

            var luceneIndex = (LuceneIndex)index;

            using (luceneIndex.ProcessNonAsync())
            {
                var dataService = new TableDirectReaderDataService();
                var randomItems = dataService.GetRandomItems(10).ToArray();
                index.IndexItems(randomItems);
                return(View(randomItems.Length));
            }
        }
Beispiel #2
0
        public ActionResult ReIndexItems(string indexName = null)
        {
            if (!ExamineManager.Instance.TryGetIndex(indexName ?? "Simple2Indexer", out var index))
            {
                return(HttpNotFound());
            }

            var items = Execute(index, i =>
            {
                var dataService = new TableDirectReaderDataService();
                var randomItems = dataService.GetRandomItems(10).ToArray();
                index.IndexItems(randomItems);
                return(randomItems.Length);
            });

            return(View(items));
        }
Beispiel #3
0
        public ActionResult ReIndexItems()
        {
            var total       = 0;
            var dataService = new TableDirectReaderDataService();

            foreach (var simpleDataSet in dataService.GetRandomItems(10))
            {
                ExamineManager.Instance.IndexProviderCollection["Simple2Indexer"]
                .ReIndexNode(
                    simpleDataSet.RowData.ToExamineXml(
                        simpleDataSet.NodeDefinition.NodeId,
                        simpleDataSet.NodeDefinition.Type),
                    "TestType");
                total++;
            }

            return(View(total));
        }