How to override Core Results Web Part's limit of 50 results per page?

By default "Core Results Web Part" can result a maximum of 50 results. But grouping results require as many items as per requirement. To achieve this, we need to create our own CoreResults Web Part. The following code snippet help to achieve that.


public class cvsearch : CoreResultsWebPart
    {
        protected override XPathNavigator GetXPathNavigator(string viewPath)
        {
            QueryManager queryManager = SharedQueryManager.GetInstance(Page).QueryManager;
            queryManager[0].ItemsPerPage = 100;
            XmlDocument xmlDocument = queryManager.GetResults(queryManager[0]);
            return xmlDocument.CreateNavigator();
        }
    }