No, there is overloaded Query constructor that accepts also MaxResult parameter.
EPiServer.Shell.Search.Query.ctor(string searchQuery, int maxResults)
But I couldn't find a code that makes use of that overload. Always query is made using first constructor which has 10 as constant.
Thanks Valdis,
Yes the Query.cs code in v6 R2 is:
namespace EPiServer.Shell.Search
{
public class Query
{
public int MaxResults { get; set; }
public string SearchQuery { get; set; }
public Query(string searchQuery)
: this(searchQuery, 10)
{
}
public Query(string searchQuery, int maxResults)
{
this.MaxResults = maxResults;
this.SearchQuery = searchQuery;
}
}
}
This suggests that there is a way to call Query with parameters setting both the searchQuery and maxResults, however there is no EPiServer code that calls the Query method with both parameters.
The Query(searchQuery) method is called from EPiServer.Shell.UI.Controllers.SearchController.Search:
epiSearchQuery = HttpUtility.HtmlDecode(epiSearchQuery); SearchController._log.Info((object) ("Searching for:'" + epiSearchQuery + "' using: " + providerFullName + " provider")); Query query = new Query(epiSearchQuery);
A client recently asked us about changing the number of items shown in the EPiServer Shell Search list. I can't believe there is no way to change this.
In the very top right hand corner of the window there is an internal search button. However I have found that this always returns only the first 10 results.
Is there anywhere where I can modify the code to set my own limit on the amount of results returned here?