Index Provider Class

Max De Los Reyes asked on January 19, 2023 17:23

Having a cyclical issue in the Smart Search application of our recently-upgraded K12 site.

On editing one of our indices, under Indexed Content, the Index Provider Class is missing. When I try to input the correct assembly name and save the changes, I am prompted with the following message: These changes require an index rebuild. Please click here to rebuild index now.

After clicking, the rebuild occurs finishes, but the changes are not saved. If I enter it again and try to save, I'm prompted with the same message to rebuild.

Does anyone have any insight? Thank you.

Recent Answers


Juraj Ondrus answered on January 23, 2023 07:28

Are there any errors in the event log? Have you tried re-signing macros? How and where is the custom index defined? Is it a class library project? Are you able to reproduce the issue on a fresh installation?

0 votesVote for this answer Mark as a Correct answer

Max De Los Reyes answered on January 23, 2023 19:47 (last edited on January 23, 2023 20:29)

Hi Juraj. Thank you for the response.

There are no errors in the event log.

As for re-signing macros, this is an issue that I haven't been able to solve for a while, and as such I've gone and fixed other problems in the mean time, one of which involved re-signing, so technically yes.

The custom index is defined by a class in our project's App_Code. It is not a library.

And yes, this issue is reproduceable on fresh installs. We have 3 or so of the same project pointed to this same database, and they are all experiencing this issue. An additional thing I've noticed is that, on our functioning K10 versions of the site, the dropdown for both the Index Provider Class' fields are working and populated, but not on these upgraded K12 versions.

Is there any place in the CMS database where I can force the value into the Index provider class field?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on January 24, 2023 08:01

It is recommended to use separate class library projects. Using the App_Code classes is obsolete. I have followed the documentation on creating custom indexes and it is working fine. I tried using the class library project as well as placing the class file into the "Old_App_Code" folder (I am using web application project so I do not have App_Code folder). I would recommend reviewing your class code according to the documentation and the best practice would be moving the code to a class library, separate assembly project. Using separate projects (libraries) for custom code has the following advantages:
- Cleaner separation of custom code from the default code of the Kentico web project.
- Compilation performance – the code of a separate project is compiled into a DLL and does not require runtime compilation that slows down the web project.
- Better accessibility of your custom classes from external applications or projects (for example MVC sites or projects running automated tests).
- Easier re-usability across multiple projects.

0 votesVote for this answer Mark as a Correct answer

Max De Los Reyes answered on January 24, 2023 16:25

Thank you Juraj, will consider doing this. Lots of benefits.

For now, do you know of any place in the CMS database where I can force the required "Assembly name" value for the Index Provider Class?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on January 25, 2023 07:03

Well, adding the value to the DB directly might not help - if the class is not detected by the app, you can have it in the DB but the code might not be executed. I would maybe focus on your code and review it and compare with the same in Kentico 12 documentation. There were made also changes how the custom module classes are registered and so on.

0 votesVote for this answer Mark as a Correct answer

Not Applicable answered on January 29, 2023 15:33

May sound obvious, but does your custom search index class implement the ICustomSearchIndex interface?

0 votesVote for this answer Mark as a Correct answer

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