No results for Smart Search on MVC

Petline developer asked on July 11, 2019 20:53

I'm using Kentico 12 MVC and want to provide smart search on the MVC site that I'm working on. So I followed the instructions here. I checked the CMS and tried the Search preview for the indexes I made and it was returning results there. I tried rebuiling and optimizing the search indexes as well, but still no results on the MVC site.

Any idea where to look? Is there a setting on the CMS that I might have overlooked? Any help would be appreciated since I really don't know why it's not working.

Recent Answers


Mike Wills answered on July 11, 2019 22:06

Hi Petline,

Just a few hunches:

  • Is the Web Farm module show that Admin app and MVC app are both healthy?
  • Is this setting checked? Version & Synchronization->Web farm>Smart search indexes
  • Does the app identity for the MVC app have the required permissions to write files?

Mike

0 votesVote for this answer Mark as a Correct answer

Tim Coy answered on July 12, 2019 01:46

I hope it is ok for me to join this thread as I came here to solve the same problem I am having using Smart Search with Kentico 11 MVC.

I followed Providing smart search on MVC sites

  • The Web farm module shows both MVC and Admin apps as healthy.
  • Settings> Version & Synchronization->Web farm>Smart search indexes is checked.
  • Files are being created in Kentico11\CMS\App_Data\CMSModules\SmartSearch\MVCSite.Index

Search Preview returns results.

I just don't know where else to look and would appreciate some help.

Tim

0 votesVote for this answer Mark as a Correct answer

Mike Wills answered on July 12, 2019 05:46

Hi Tim,

Is your MVCSite.Index also in this folder in the MVC application?

~/App_Data/CMSModules/SmartSearch/

I would expect Web Farm Tasks to synchronize the index files from the CMS app to the MVC app.

You could also check:

  • Are there any relevant tasks listed in the Web Farm module's Tasks tab?
  • Is the Kentico.Search NuGet package added to your MVC project?

Mike

2 votesVote for this answer Mark as a Correct answer

Tim Coy answered on July 12, 2019 06:03 (last edited on July 12, 2019 06:04)

Hi Mike

Thank you for your response.

As a quick test I manually copied the SmartSearch Folder to ~/App_Data/CMSModules/SmartSearch/ which was missing.

I am now getting some results returned in my MVC app, so thank you.

I just need to diagnose why the folder is not being synced there in the first place. The Task list is empty in the Web Farm modules tab. So I imagine my problem is around this area.

I did not use the Kentico.Search package, I did write my own based on the code from there however.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on July 12, 2019 06:27

Hi Tim,

I faced similar problem and in my case the index files were missing because web application didn't have "write" access to App_Data folder so souldn't just create these files.

2 votesVote for this answer Mark as a Correct answer

Tim Coy answered on July 12, 2019 07:42

Thanks Dmitry, the permissions look ok to me, but I am not a Windows person or even a .NET dev, but I will investigate it further.

0 votesVote for this answer Mark as a Correct answer

Mike Wills answered on July 12, 2019 23:00

Tim,

My Web Farm task list is empty too, but the index files still propagated.

Did you try turning on "Enable web farm debug"? In Settings, I went to System->Debug, and turned on:

  • Enable web farm debug
  • Log web farm operations to file

Kentico created "logWebFarm.log" in ~\App_Data\CMSTemp\Debug. Maybe this will provide a clue.

Also, are you using any storage providers other than the default, like AzureStorage?

Mike

1 votesVote for this answer Mark as a Correct answer

Tim Coy answered on July 14, 2019 03:11 (last edited on July 15, 2019 05:41)

Thanks Mike. I have enabled logging and the log files are being created. I will see what I can learn from them.

I suspect my sync problem is caused by write permissions. (Edit: I have rectified my problem by setting the permissions on the folder, Thank you)

I am using local file storage.

0 votesVote for this answer Mark as a Correct answer

Petline developer answered on July 16, 2019 17:37

Thanks Mike for getting back to me, sorry my late reply. So all checks for healthy webfarm are good.

Only thing I am not clear about is "MVCSite.Index", do I need to create this file under the MVC app solution (not the website) ?

0 votesVote for this answer Mark as a Correct answer

Mike Wills answered on July 16, 2019 21:26

Hi Petline,

You do not need to create a file or folder named MVCSite.Index. That just happened to be the code name for Tim's index. A folder for each index should automatically be created under ~/App_Data/CMSModules/SmartSearch/.

Mike

0 votesVote for this answer Mark as a Correct answer

Petline developer answered on July 18, 2019 15:02

Thanks Mike, so the issue still exist, no results on my MVC site, but when I try the preview search it works and return values, any advise ?

0 votesVote for this answer Mark as a Correct answer

Mike Wills answered on July 18, 2019 18:46

Did you configure Webfarm debugging as described above? This helped Tim identify a permissions issue.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.