November Happy Hour will be moved to Thursday December 5th.

EpiServer internal search

Vote:
 

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?

#59003
May 15, 2012 16:33
Vote:
 

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.

#59015
May 16, 2012 9:09
Vote:
 

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);
#59022
May 16, 2012 12:15
Vote:
 

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. 

#69546
Mar 27, 2013 9:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.