public long RunWhereItemEnumerable() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem(Sitecore.ItemIDs.RootID).Axes.GetDescendants().Where(item => item.TemplateName == "Sample Item").Take(20); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereQuery() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("/sitecore//*[@@templatename = 'Sample Item']"); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereItemEnumerable5() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}").Axes.GetAncestors().Take(20); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereItemEnumerable6() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem(Sitecore.ItemIDs.RootID).Axes.GetDescendants().Where(item => item.Statistics.Created > DateTime.Now.AddDays((-100))).Take(20); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereFastQuery4() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("fast:/sitecore//*").Take(20); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereFastQuery5() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("fast:/sitecore/system/Settings/Buckets/Search Types/Author/ancestor::*").Take(20); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereLinq6() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var run = context.GetQueryable <SearchResultItem>().Where(item => item.CreatedDate > DateTime.Now.AddDays(-100)).Take(20).ToList(); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereLinq2() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var run = context.GetQueryable <SearchResultItem>().Where(item => item.TemplateName.Contains("Sam")).Take(20).ToList(); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereQuery6() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("/sitecore//*[@__Updated >= '20090101']").Take(20); foreach (var item in run) { } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereFastQuery5() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("fast:/sitecore/system/Settings/Buckets/Search Types/Author/ancestor::*").Take(20); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereFastQuery4() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("fast:/sitecore//*").Take(20); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { TermQuery ftQuery = new TermQuery(new Term("_templatename", "sample item")); SearchHits results = context.Search(ftQuery); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereFastQuery3() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("fast:/sitecore/*[@@templatename = 'Sample Item']"); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereLinq5() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}"); var results = context.GetQueryable <ExtendedSearchResultItem>().Where(i => i["_group"] == id1); results.First().GetAncestors <SearchResultItem>(context).Take(20); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager6() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}"); TermRangeQuery ftQuery = new TermRangeQuery("__updated", "20090101", "20130505", true, true); SearchHits results = context.Search(ftQuery); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager5() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}"); TermQuery ftQuery = new TermQuery(new Term("_path", id1)); SearchHits results = context.Search(ftQuery); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereLinq3() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid(Sitecore.ItemIDs.RootID); var results = context.GetQueryable <ExtendedSearchResultItem>().Where(i => i["_group"] == id1); results.First().GetChildren <SearchResultItem>(context).Where(template => template.TemplateName == "Sample Item"); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager3() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid(Sitecore.ItemIDs.RootID); TermQuery ftQuery = new TermQuery(new Term("_parent", id1)); SearchHits results = context.Search(ftQuery); } return(queryTimer.StopWatch.ElapsedTicks / 1000); } }
public long RunWhereLinq4() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid(Sitecore.ItemIDs.RootID); var results = context.GetQueryable<ExtendedSearchResultItem>().Where(i => i["_group"] == id1); results.First().GetDescendants<SearchResultItem>(context).Take(20); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager6() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}"); TermRangeQuery ftQuery = new TermRangeQuery("__updated", "20090101", "20130505", true, true); SearchHits results = context.Search(ftQuery); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager5() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}"); TermQuery ftQuery = new TermQuery(new Term("_path", id1)); SearchHits results = context.Search(ftQuery); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager4() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid(Sitecore.ItemIDs.RootID); TermQuery ftQuery = new TermQuery(new Term("_path", id1)); SearchHits results = context.Search(ftQuery); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
//NOTE: This required me to bring in the Lucene.Net Reference public long RunWhereSearchManager2() { using (var queryTimer = new QueryTimer()) { using (var context = SearchManager.GetIndex("system").CreateSearchContext()) { WildcardQuery ftQuery = new WildcardQuery(new Term("_templatename", "*sam*")); SearchHits results = context.Search(ftQuery); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereQuery6() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("/sitecore//*[@__Updated >= '20090101']").Take(20); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereQuery2() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.SelectItems("/sitecore//*[contains(@@templatename, 'Sam')]"); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereLinq6() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var run = context.GetQueryable<SearchResultItem>().Where(item => item.CreatedDate > DateTime.Now.AddDays(-100)).Take(20).ToList(); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereItemEnumerable3() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem(Sitecore.ItemIDs.RootID).GetChildren().Where(item => item.TemplateName == "Sample Item"); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereLinq2() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var run = context.GetQueryable<SearchResultItem>().Where(item => item.TemplateName.Contains("Sam")).Take(20).ToList(); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereItemEnumerable6() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem(Sitecore.ItemIDs.RootID).Axes.GetDescendants().Where(item => item.Statistics.Created > DateTime.Now.AddDays((-100))).Take(20); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereItemEnumerable5() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}").Axes.GetAncestors().Take(20); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereItemEnumerable4() { using (var queryTimer = new QueryTimer()) { var run = Sitecore.Context.Database.GetItem(Sitecore.ItemIDs.RootID).Axes.GetDescendants().Take(20); foreach (var item in run) { } return queryTimer.StopWatch.ElapsedTicks / 1000; } }
public long RunWhereLinq5() { using (var queryTimer = new QueryTimer()) { using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { var id1 = IdHelper.NormalizeGuid("{16156647-DE5D-4E6A-A6AE-5B8D4A3A40BE}"); var results = context.GetQueryable<ExtendedSearchResultItem>().Where(i => i["_group"] == id1); results.First().GetAncestors<SearchResultItem>(context).Take(20); } return queryTimer.StopWatch.ElapsedTicks / 1000; } }