marcel_g
marcel_g

Reputation: 2030

Kentico 9 MVC - calling Smart Search causes IIS Express worker process to crash

We were working on it in Kentico 8, but upgraded to 9 because we thought it would make the MVC part easier, such as bringing in a lot of our existing MVC code, and writing the more code heavy pages in MVC instead of trying to make custom webparts for everything, so that it would be a portal/mvc hybrid. The client can work on their content pages, and we can quickly hook up some MVC pages to our existing infrastructure.

However, nothing's working very well right now, we're having a lot of trouble with it. There was a ton of config wrestling to get the MVC site to work as a virtual directory under the CMSApp.

Most of the time when I try to call Smart Search using the API from an MVC controller while debugging, the IIS Express worker process crashes, so I have no idea where the problem is.

We basically copied our code from the Kentico 9 MVC example here: https://github.com/Kentico/Mvc

[ValidateInput( false )]
    public ActionResult Index( string searchText, int? page )
    {
        var pageIndex = ( page ?? 1 ) - 1;
        int totalItemsCount;
        var model = new SearchResults()
        {
            Items = mService.Search( searchText, pageIndex, PAGE_SIZE, out totalItemsCount ),
            PageIndex = pageIndex,
            PageSize = PAGE_SIZE,
            Query = searchText,
            TotalItemCount = totalItemsCount
        };

        return View( model );
    }

And we set up the Kentico SearchService in the SearchController manually like so:

        public SearchController()
    {

        var indexInfos = SearchIndexInfoProvider.GetSearchIndexes();

        string[] indexNames = (from i in indexInfos
            select i.IndexCodeName).ToArray();

        mService = new SearchService( indexNames, CultureHelper.GetDefaultCultureCode( "SCGDEV" ), "SCGDEV",true );
    }

We're using VS 2013, and the Kentico set up is an ASPX/Portal hybrid so the client can add content using the portal, and we can integrate all the custom legacy functionality via the MVC project, which is set up as a virtual directory within the main WebApp solution.

Going with the MVC project for our custom code seemed like it would be a lot faster than trying to create a pile of custom webparts to do the same functions that we already have built.

Any suggestions would be appreciated. I've also opened a support ticket with Kentico, so maybe there's a bug on their side.

Upvotes: 0

Views: 265

Answers (1)

Roman Hutnyk
Roman Hutnyk

Reputation: 1549

I'd try to rebuild search index first and make sure it works fine in Kentico Admin interface. Then make sure index has been successfully synced to MVC application. If above conditions are met, but issue still exists - I'd check Windows event log for error details, which might give you an idea on further steps.

Questions: What is the size of the index? Are there any memory limits setup for app pool on IIS?

Upvotes: 2

Related Questions