diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 8278dac171..13db7ce7cb 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -88,7 +88,7 @@
-
+
diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs
index 31109485f6..4d7a21ffef 100644
--- a/src/Umbraco.Web/Editors/EntityController.cs
+++ b/src/Umbraco.Web/Editors/EntityController.cs
@@ -590,7 +590,7 @@ namespace Umbraco.Web.Editors
///
///
///
- private IEnumerable
ExamineSearch(string query, UmbracoEntityTypes entityType, string searchFrom = null)
+ private IEnumerable ExamineSearch(string query, UmbracoEntityTypes entityType, string searchFrom = null)
{
return _treeSearcher.ExamineSearch(query, entityType, 200, 0, out _, searchFrom);
}
diff --git a/src/Umbraco.Web/Editors/ExamineManagementController.cs b/src/Umbraco.Web/Editors/ExamineManagementController.cs
index ab60f64e49..f624f2cee3 100644
--- a/src/Umbraco.Web/Editors/ExamineManagementController.cs
+++ b/src/Umbraco.Web/Editors/ExamineManagementController.cs
@@ -9,13 +9,18 @@ using System.Web.Http;
using Examine;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Providers;
+using Lucene.Net.Analysis;
+using Lucene.Net.QueryParsers;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Examine;
+using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.Search;
+using SearchResult = Umbraco.Web.Models.ContentEditing.SearchResult;
+using Version = Lucene.Net.Util.Version;
namespace Umbraco.Web.Editors
{
@@ -54,40 +59,59 @@ namespace Umbraco.Web.Editors
public IEnumerable GetSearcherDetails()
{
var model = new List(
- _examineManager.RegisteredSearchers.Select(searcher => new ExamineSearcherModel{Name = searcher.Name})
+ _examineManager.RegisteredSearchers.Select(searcher => new ExamineSearcherModel { Name = searcher.Name })
.OrderBy(x => x.Name.TrimEnd("Searcher"))); //order by name , but strip the "Searcher" from the end if it exists
return model;
}
- public ISearchResults GetSearchResults(string searcherName, string query, string queryType)
+ public SearchResults GetSearchResults(string searcherName, string query, int pageIndex = 0, int pageSize = 20)
{
- if (queryType == null)
- {
- throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
- }
-
if (query.IsNullOrWhiteSpace())
+ return SearchResults.Empty();
+
+ var msg = ValidateSearcher(searcherName, out var searcher);
+ if (!msg.IsSuccessStatusCode)
+ throw new HttpResponseException(msg);
+
+ var results = TryParseLuceneQuery(query)
+ ? searcher.Search(searcher.CreateCriteria().RawQuery(query), maxResults: pageSize * (pageIndex + 1))
+ : searcher.Search(query, true, maxResults: pageSize * (pageIndex + 1));
+
+ var pagedResults = results.Skip(pageIndex * pageSize);
+
+ return new SearchResults
{
- return LuceneSearchResults.Empty();
- }
+ TotalRecords = results.TotalItemCount,
+ Results = pagedResults.Select(x => new SearchResult
+ {
+ Id = x.Id,
+ Score = x.Score,
+ Values = x.Values
+ })
+ };
+ }
- var msg = ValidateLuceneSearcher(searcherName, out var searcher);
- if (msg.IsSuccessStatusCode)
+ private bool TryParseLuceneQuery(string query)
+ {
+ //TODO: I'd assume there would be a more strict way to parse the query but not that i can find yet, for now we'll
+ // also do this rudimentary check
+ if (!query.Contains(":"))
+ return false;
+
+ try
{
- if (queryType.InvariantEquals("text"))
- {
- return searcher.Search(query, false);
- }
-
- if (queryType.InvariantEquals("lucene"))
- {
- return searcher.Search(searcher.CreateCriteria().RawQuery(query));
- }
-
- throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
+ //This will pass with a plain old string without any fields, need to figure out a way to have it properly parse
+ var parsed = new QueryParser(Version.LUCENE_30, "nodeName", new KeywordAnalyzer()).Parse(query);
+ return true;
+ }
+ catch (ParseException)
+ {
+ return false;
+ }
+ catch (Exception)
+ {
+ return false;
}
-
- throw new HttpResponseException(msg);
}
///
@@ -174,7 +198,7 @@ namespace Umbraco.Web.Editors
}
}
-
+
private ExamineIndexModel CreateModel(IIndex index)
{
@@ -200,39 +224,24 @@ namespace Umbraco.Web.Editors
ProviderProperties = properties,
CanRebuild = _indexRebuilder.CanRebuild(indexName)
};
-
+
return indexerModel;
}
- private HttpResponseMessage ValidateLuceneSearcher(string searcherName, out LuceneSearcher searcher)
+ private HttpResponseMessage ValidateSearcher(string searcherName, out ISearcher searcher)
{
- foreach (var indexer in _examineManager.Indexes)
+ //try to get the searcher from the indexes
+ if (_examineManager.TryGetIndex(searcherName, out var index))
{
- var s = indexer.GetSearcher();
- var sName = (s as BaseLuceneSearcher)?.Name ?? string.Concat(indexer.Name, "Searcher");
- if (sName != searcherName)
- {
- continue;
- }
-
- searcher = s as LuceneSearcher;
-
- //Found it, return OK
- if (searcher != null)
- {
- return Request.CreateResponse(HttpStatusCode.OK);
- }
-
- //Return an error since it's not the right type
- var response = Request.CreateResponse(HttpStatusCode.BadRequest);
- response.Content =
- new StringContent($"The searcher {searcherName} is not of type {typeof(LuceneSearcher)}");
- response.ReasonPhrase = "Wrong Searcher Type";
- return response;
+ searcher = index.GetSearcher();
+ return Request.CreateResponse(HttpStatusCode.OK);
}
- searcher = null;
+
+ //if we didn't find anything try to find it by an explicitly declared searcher
+ if (_examineManager.TryGetSearcher(searcherName, out searcher))
+ return Request.CreateResponse(HttpStatusCode.OK);
var response1 = Request.CreateResponse(HttpStatusCode.BadRequest);
response1.Content = new StringContent($"No searcher found with name = {searcherName}");
@@ -269,7 +278,7 @@ namespace Umbraco.Web.Editors
private void Indexer_IndexOperationComplete(object sender, EventArgs e)
{
- var indexer = (LuceneIndex) sender;
+ var indexer = (LuceneIndex)sender;
//ensure it's not listening anymore
indexer.IndexOperationComplete -= Indexer_IndexOperationComplete;
diff --git a/src/Umbraco.Web/ExamineExtensions.cs b/src/Umbraco.Web/ExamineExtensions.cs
index fa5ce64426..f1ed6c0659 100644
--- a/src/Umbraco.Web/ExamineExtensions.cs
+++ b/src/Umbraco.Web/ExamineExtensions.cs
@@ -12,7 +12,7 @@ namespace Umbraco.Web
///
public static class ExamineExtensions
{
- public static IEnumerable ToPublishedSearchResults(this IEnumerable results, IPublishedCache cache)
+ public static IEnumerable ToPublishedSearchResults(this IEnumerable results, IPublishedCache cache)
{
var list = new List();
diff --git a/src/Umbraco.Web/IPublishedContentQuery.cs b/src/Umbraco.Web/IPublishedContentQuery.cs
index 80af19c941..3ab1c5e3ae 100644
--- a/src/Umbraco.Web/IPublishedContentQuery.cs
+++ b/src/Umbraco.Web/IPublishedContentQuery.cs
@@ -39,7 +39,7 @@ namespace Umbraco.Web
///
/// Searches content.
///
- IEnumerable Search(int skip, int take, out int totalRecords, string term, bool useWildCards = true, string indexName = null);
+ IEnumerable Search(int skip, int take, out long totalRecords, string term, bool useWildCards = true, string indexName = null);
///
/// Searches content.
@@ -49,6 +49,6 @@ namespace Umbraco.Web
///
/// Searches content.
///
- IEnumerable Search(int skip, int take, out int totalRecords, Examine.SearchCriteria.ISearchCriteria criteria, Examine.ISearcher searcher = null);
+ IEnumerable Search(int skip, int take, out long totalRecords, Examine.SearchCriteria.ISearchCriteria criteria, Examine.ISearcher searcher = null);
}
}
diff --git a/src/Umbraco.Web/Models/ContentEditing/SearchResult.cs b/src/Umbraco.Web/Models/ContentEditing/SearchResult.cs
new file mode 100644
index 0000000000..1cdd539165
--- /dev/null
+++ b/src/Umbraco.Web/Models/ContentEditing/SearchResult.cs
@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace Umbraco.Web.Models.ContentEditing
+{
+ [DataContract(Name = "result", Namespace = "")]
+ public class SearchResult
+ {
+ [DataMember(Name = "id")]
+ public string Id { get; set; }
+
+ [DataMember(Name = "score")]
+ public float Score { get; set; }
+
+ [DataMember(Name = "fieldCount")]
+ public int FieldCount => Values?.Count ?? 0;
+
+ [DataMember(Name = "values")]
+ public IReadOnlyDictionary Values { get; set; }
+ }
+}
diff --git a/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs b/src/Umbraco.Web/Models/ContentEditing/SearchResultEntity.cs
similarity index 86%
rename from src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs
rename to src/Umbraco.Web/Models/ContentEditing/SearchResultEntity.cs
index 5ba89806d0..a1cca9763d 100644
--- a/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs
+++ b/src/Umbraco.Web/Models/ContentEditing/SearchResultEntity.cs
@@ -3,7 +3,7 @@
namespace Umbraco.Web.Models.ContentEditing
{
[DataContract(Name = "searchResult", Namespace = "")]
- public class SearchResultItem : EntityBasic
+ public class SearchResultEntity : EntityBasic
{
///
/// The score of the search result
diff --git a/src/Umbraco.Web/Models/ContentEditing/SearchResults.cs b/src/Umbraco.Web/Models/ContentEditing/SearchResults.cs
new file mode 100644
index 0000000000..f791d55cab
--- /dev/null
+++ b/src/Umbraco.Web/Models/ContentEditing/SearchResults.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+
+namespace Umbraco.Web.Models.ContentEditing
+{
+ [DataContract(Name = "results", Namespace = "")]
+ public class SearchResults
+ {
+ public static SearchResults Empty() => new SearchResults
+ {
+ Results = Enumerable.Empty(),
+ TotalRecords = 0
+ };
+
+ [DataMember(Name = "totalRecords")]
+ public long TotalRecords { get; set; }
+
+ [DataMember(Name = "results")]
+ public IEnumerable Results { get; set; }
+ }
+}
diff --git a/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs b/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs
index 964ed62c88..22c177190d 100644
--- a/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs
+++ b/src/Umbraco.Web/Models/ContentEditing/TreeSearchResult.cs
@@ -30,6 +30,6 @@ namespace Umbraco.Web.Models.ContentEditing
public string JsFormatterMethod { get; set; }
[DataMember(Name = "results")]
- public IEnumerable Results { get; set; }
+ public IEnumerable Results { get; set; }
}
}
diff --git a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs
index 4028d480db..3e42178fbd 100644
--- a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs
+++ b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs
@@ -84,7 +84,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.Trashed, opt => opt.Ignore())
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore());
- CreateMap()
+ CreateMap()
.ForMember(dest => dest.Udi, opt => opt.MapFrom(src => Udi.Create(ObjectTypes.GetUdiType(src.NodeObjectType), src.Key)))
.ForMember(dest => dest.Icon, opt => opt.MapFrom(src=> GetContentTypeIcon(src)))
.ForMember(dest => dest.Trashed, opt => opt.Ignore())
@@ -107,7 +107,7 @@ namespace Umbraco.Web.Models.Mapping
}
});
- CreateMap()
+ CreateMap()
//default to document icon
.ForMember(dest => dest.Score, opt => opt.MapFrom(result => result.Score))
.ForMember(dest => dest.Udi, opt => opt.Ignore())
@@ -174,11 +174,11 @@ namespace Umbraco.Web.Models.Mapping
}
});
- CreateMap>()
- .ConvertUsing(results => results.Select(Mapper.Map).ToList());
+ CreateMap>()
+ .ConvertUsing(results => results.Select(Mapper.Map).ToList());
- CreateMap, IEnumerable>()
- .ConvertUsing(results => results.Select(Mapper.Map).ToList());
+ CreateMap, IEnumerable>()
+ .ConvertUsing(results => results.Select(Mapper.Map).ToList());
}
///
diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
index ccfe947515..d681d9296e 100644
--- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
+++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
@@ -354,7 +354,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
return null;
}
- internal CacheValues ConvertFromSearchResult(SearchResult searchResult)
+ internal CacheValues ConvertFromSearchResult(ISearchResult searchResult)
{
// note: fixing fields in 7.x, removed by Shan for 8.0
diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs
index ed42181234..1883010582 100644
--- a/src/Umbraco.Web/PublishedContentQuery.cs
+++ b/src/Umbraco.Web/PublishedContentQuery.cs
@@ -227,7 +227,7 @@ namespace Umbraco.Web
}
///
- public IEnumerable Search(int skip, int take, out int totalRecords, string term, bool useWildCards = true, string indexName = null)
+ public IEnumerable Search(int skip, int take, out long totalRecords, string term, bool useWildCards = true, string indexName = null)
{
//fixme: inject IExamineManager
@@ -260,7 +260,7 @@ namespace Umbraco.Web
}
///
- public IEnumerable Search(int skip, int take, out int totalRecords, ISearchCriteria criteria, ISearcher searcher = null)
+ public IEnumerable Search(int skip, int take, out long totalRecords, ISearchCriteria criteria, ISearcher searcher = null)
{
if (_query != null) return _query.Search(skip, take, out totalRecords, criteria, searcher);
diff --git a/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs b/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
index 9b98d02a10..9aab30edae 100644
--- a/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
+++ b/src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
@@ -12,6 +12,7 @@ using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Trees;
+using SearchResult = Examine.SearchResult;
namespace Umbraco.Web.Search
{
@@ -41,7 +42,7 @@ namespace Umbraco.Web.Search
///
///
///
- public IEnumerable ExamineSearch(
+ public IEnumerable ExamineSearch(
string query,
UmbracoEntityTypes entityType,
int pageSize,
@@ -109,7 +110,7 @@ namespace Umbraco.Web.Search
if (searchFrom.IsNullOrWhiteSpace() && query.IsNullOrWhiteSpace())
{
totalFound = 0;
- return new List();
+ return new List();
}
//update the query with the query term
@@ -143,7 +144,7 @@ namespace Umbraco.Web.Search
if (searchFrom.IsNullOrWhiteSpace() && trimmed.IsNullOrWhiteSpace())
{
totalFound = 0;
- return new List();
+ return new List();
}
//update the query with the query term
@@ -277,9 +278,9 @@ namespace Umbraco.Web.Search
///
///
///
- private IEnumerable MemberFromSearchResults(SearchResult[] results)
+ private IEnumerable MemberFromSearchResults(ISearchResult[] results)
{
- var mapped = Mapper.Map>(results).ToArray();
+ var mapped = Mapper.Map>(results).ToArray();
//add additional data
foreach (var m in mapped)
{
@@ -310,9 +311,9 @@ namespace Umbraco.Web.Search
///
///
///
- private IEnumerable MediaFromSearchResults(IEnumerable results)
+ private IEnumerable MediaFromSearchResults(IEnumerable results)
{
- var mapped = Mapper.Map>(results).ToArray();
+ var mapped = Mapper.Map>(results).ToArray();
//add additional data
foreach (var m in mapped)
{
@@ -330,9 +331,9 @@ namespace Umbraco.Web.Search
///
///
///
- private IEnumerable ContentFromSearchResults(IEnumerable results)
+ private IEnumerable ContentFromSearchResults(IEnumerable results)
{
- var mapped = Mapper.Map>(results).ToArray();
+ var mapped = Mapper.Map>(results).ToArray();
//add additional data
foreach (var m in mapped)
{
diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs
index 35c335f06d..d2b94c815b 100644
--- a/src/Umbraco.Web/Trees/ContentTreeController.cs
+++ b/src/Umbraco.Web/Trees/ContentTreeController.cs
@@ -319,7 +319,7 @@ namespace Umbraco.Web.Trees
menuItem.OpensDialog = opensDialog;
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
return _treeSearcher.ExamineSearch(query, UmbracoEntityTypes.Document, pageSize, pageIndex, out totalFound, searchFrom);
}
diff --git a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs
index 43e5b03f2f..0ef3c073eb 100644
--- a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs
+++ b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs
@@ -142,10 +142,10 @@ namespace Umbraco.Web.Trees
return menu;
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
var results = Services.EntityService.GetPagedDescendants(UmbracoObjectTypes.DocumentType, pageIndex, pageSize, out totalFound, filter: query);
- return Mapper.Map>(results);
+ return Mapper.Map>(results);
}
}
}
diff --git a/src/Umbraco.Web/Trees/DataTypeTreeController.cs b/src/Umbraco.Web/Trees/DataTypeTreeController.cs
index 6c89f4a1dc..0970481357 100644
--- a/src/Umbraco.Web/Trees/DataTypeTreeController.cs
+++ b/src/Umbraco.Web/Trees/DataTypeTreeController.cs
@@ -142,10 +142,10 @@ namespace Umbraco.Web.Trees
return menu;
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
var results = Services.EntityService.GetPagedDescendants(UmbracoObjectTypes.DataType, pageIndex, pageSize, out totalFound, filter: query);
- return Mapper.Map>(results);
+ return Mapper.Map>(results);
}
}
}
diff --git a/src/Umbraco.Web/Trees/ISearchableTree.cs b/src/Umbraco.Web/Trees/ISearchableTree.cs
index 6e52b054b4..4146bfaf45 100644
--- a/src/Umbraco.Web/Trees/ISearchableTree.cs
+++ b/src/Umbraco.Web/Trees/ISearchableTree.cs
@@ -21,6 +21,6 @@ namespace Umbraco.Web.Trees
/// A starting point for the search, generally a node id, but for members this is a member type alias
///
///
- IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null);
+ IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null);
}
}
diff --git a/src/Umbraco.Web/Trees/MediaTreeController.cs b/src/Umbraco.Web/Trees/MediaTreeController.cs
index 4efddfb4b3..8533081dde 100644
--- a/src/Umbraco.Web/Trees/MediaTreeController.cs
+++ b/src/Umbraco.Web/Trees/MediaTreeController.cs
@@ -164,7 +164,7 @@ namespace Umbraco.Web.Trees
return HasPathAccess(entity, queryStrings);
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
return _treeSearcher.ExamineSearch(query, UmbracoEntityTypes.Media, pageSize, pageIndex, out totalFound, searchFrom);
}
diff --git a/src/Umbraco.Web/Trees/MediaTypeTreeController.cs b/src/Umbraco.Web/Trees/MediaTypeTreeController.cs
index 547199676a..8b3ad5e8cd 100644
--- a/src/Umbraco.Web/Trees/MediaTypeTreeController.cs
+++ b/src/Umbraco.Web/Trees/MediaTypeTreeController.cs
@@ -133,10 +133,10 @@ namespace Umbraco.Web.Trees
return menu;
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
var results = Services.EntityService.GetPagedDescendants(UmbracoObjectTypes.MediaType, pageIndex, pageSize, out totalFound, filter: query);
- return Mapper.Map>(results);
+ return Mapper.Map>(results);
}
}
}
diff --git a/src/Umbraco.Web/Trees/MemberTreeController.cs b/src/Umbraco.Web/Trees/MemberTreeController.cs
index 3317bfbdf9..ae2ad1824d 100644
--- a/src/Umbraco.Web/Trees/MemberTreeController.cs
+++ b/src/Umbraco.Web/Trees/MemberTreeController.cs
@@ -192,7 +192,7 @@ namespace Umbraco.Web.Trees
return menu;
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
return _treeSearcher.ExamineSearch(query, UmbracoEntityTypes.Member, pageSize, pageIndex, out totalFound, searchFrom);
}
diff --git a/src/Umbraco.Web/Trees/TemplatesTreeController.cs b/src/Umbraco.Web/Trees/TemplatesTreeController.cs
index 3fc005d670..56f47695a0 100644
--- a/src/Umbraco.Web/Trees/TemplatesTreeController.cs
+++ b/src/Umbraco.Web/Trees/TemplatesTreeController.cs
@@ -133,10 +133,10 @@ namespace Umbraco.Web.Trees
: null;
}
- public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
+ public IEnumerable Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
var results = Services.EntityService.GetPagedDescendants(UmbracoObjectTypes.Template, pageIndex, pageSize, out totalFound, filter: query);
- return Mapper.Map>(results);
+ return Mapper.Map>(results);
}
}
}
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index cda21b029c..1ebb54248d 100755
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -62,7 +62,7 @@
-
+
2.6.2.25
@@ -151,6 +151,8 @@
+
+
@@ -944,7 +946,7 @@
-
+
diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs
index aa30fff0ec..357c8a30a6 100644
--- a/src/Umbraco.Web/UmbracoHelper.cs
+++ b/src/Umbraco.Web/UmbracoHelper.cs
@@ -836,7 +836,7 @@ namespace Umbraco.Web
///
///
///
- public IEnumerable TypedSearch(int skip, int take, out int totalRecords, string term, bool useWildCards = true, string searchProvider = null)
+ public IEnumerable TypedSearch(int skip, int take, out long totalRecords, string term, bool useWildCards = true, string searchProvider = null)
{
return ContentQuery.Search(skip, take, out totalRecords, term, useWildCards, searchProvider);
}
@@ -850,7 +850,7 @@ namespace Umbraco.Web
///
///
///
- public IEnumerable TypedSearch(int skip, int take, out int totalRecords, Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null)
+ public IEnumerable TypedSearch(int skip, int take, out long totalRecords, Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null)
{
return ContentQuery.Search(skip, take, out totalRecords, criteria, searchProvider);
}