smart search indexes

Farah El Agha asked on October 30, 2017 14:54

Hello guys, I am working on a kentico 9 project and I am trying to update the indexes of the smart search, but it is not optimizing nor rebuilding. whenever I press one of these two tasks, the kentico system informs me that this task has been scheduled. But no matter how much time I wait, nothing seems to change and the indexes are not rebuilding. What could be the problem? and what should I have to do to update the index? Please note that I have created another index with other values and I tried to rebuild it after saving the changes but also the same result!

Recent Answers


Rui Wang answered on October 30, 2017 15:20

Check the Smart Search > Tasks, do you see a lot of tasks stock in there? If so, you need to delete all those from database (sorry there is no select all and delete in the UI).

Once it's cleared, try to rebuild again. Depending on how many web instance uses this database, there could be tasks generated for web server instances that are not available to process the tasks.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 30, 2017 15:27

yes I have deleted them all and then refreshed, but still whenever I press rebuild nothing happens, only this message is shown : "..task has been scheduled..." and the task is shown in the Smart Search > Tasks but never processed

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 30, 2017 15:31

did you setup the project from a backup? can you check to see if the \CMS\App_Data\CMSModules\SmartSearch folder has the user that's is running the web site in app pool with Modify permission? That account need to be able to write index to file system. Also, look into Even Log app to see if there are any error after you try to rebuild index.

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on October 30, 2017 15:33

Any errors in the Event Log? Can you see the index files in the following folder:

root - \CMS\App_Data\CMSModules\SmartSearch[indexname]\

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 30, 2017 15:41 (last edited on October 30, 2017 15:44)

well, no errors in logs, but for the permissions I dont think I have set it up, I opened this folder to see the user but all I saw was 4 folders: _Synonyms, _StopWords, MyWebsite-Pages, Elections (website name), how do I update my permissions to modify?

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 30, 2017 15:44 (last edited on October 30, 2017 15:46)

look in IIS, find the user account that's running the app pool for this site (e.g. Networks Services). Add that user to the permission of the \SmartSearch folder with Modify permission.

Also, look inside MyWebsite-Pages, Elections folder, do you see CFS or DEL files? Sort by date, when was the latest modify happen?

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 30, 2017 15:52 (last edited on October 30, 2017 16:07)

well no, in MyWebsite-Pages folder there is only segments.gen and in elections I have: _2i_f.del that is last updated

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 30, 2017 16:01

Do you have any team member that knows IIS or is a system admin? These are very simple admin tasks.

Here is screenshot on how to find the user running app pool in IIS Image Text

Here is that user be added to the smartsearch folder with modify permission Image Text

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 30, 2017 19:14

Hi,
What is the exact version including hotfix? I would try the latest hotfix. Then, are you using Amazon or other external storage?
Also, are you using the scheduler to execute search tasks? If yes, when you disable it is the index rebuilt?

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on October 31, 2017 08:16

Hi Farah,

Sometimes I did this stupidity of not defining the culture of the smart search index and kept on digging here and there and finally I checked event logs to realize this small error. I hope that's not the case with you. But no harm in checking this.

What does event log says otherwise?

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 10:52 (last edited on October 31, 2017 10:53)

hello, @Juraj Ondrus the version is: 9.0.5802.28876, and no I am not using Amazon for external storage. and actually I dont know if the scheduler is used but i didnt try to disable it. @Chetan Sharma I made sure my index has the culture defined before rebuilding, thank you. As an update, today I opened my PC to find that the index is rebuilt and optimized but only for 1 file:

Indexed items: 1

Index file size: 4.8 kB

Index status: Ready

Optimized: Yes

and when I try to rebuild I get the same result, nothing happens and it does'nt seem responding, it is only adding the task to the stack of smart search tasks

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 31, 2017 10:57

What is the version number displayed in the admin UI - when you click the question mark icon upper right hand corner? The build number sounds like a custom build. It is not listed among the official hotfix releases.
I would try applying the latest hotfix as well. Then, what is set as indexed content?
Also, check whether you are using the scheduler to execute the tasks or not, this is pretty important to know.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 11:48 (last edited on October 31, 2017 11:48)

when I press the Question mark button it shows V9.0, Finally in the web.config file I found this line: <add key="CMSProcessSearchTasksByScheduler" value ="true" /> and I removed it to disable the scheduler, it rebuilt but shows:

Indexed items: 1009

Index file size: 2 MB

Index status: Ready

Optimized: Yes

Last update: 10/31/2017 12:41:44 PM

Last rebuild: 10/31/2017 12:41:44 PM

but when testing the search it does'nt return anything, noting that the indexed content is all pages (I added "/" for all pages and "/%" for all sub pages) compared to the index file size: 2MB, something is wrong right? does it affect the results if the structure of the project is template based and not web part based?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 31, 2017 11:49

Please, apply the latest hotfix for Kentico 9 - there were several bugs in smart search, so we can rule them out.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 12:19

ok I will try it and let you know if it worked. thank you.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 13:13

back again, I applied the hotfixes, and the version is now 9.0.50, and the index is easily rebuilding and optimizing (now after disabling the scheduler), still the only problem is that the index does not have the values contained in the HTML pages and when testing the search results, it returns nothing, let me ask you this straight question, if the data is coming from the page template (where everything is an HTML code under a visual studio aspx page) and not from a web part content, does the smart search find it?

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 31, 2017 14:08

What is the index type? Page or Page Crawler?

Are they content entered within the Admin UI? If so, there should be result. Did you try the Search result test within that index created in Smart Search. Did you get any result there because you do have 1000+ item indexed.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on October 31, 2017 14:16

Hi Farah,

As Rui suggested it depends upon the index type. Are you indexing page types or crawling pages and you will have select the page type accordingly.

What you need actually is a Page Crawler Indexes.

Go to this page and search for Page Crawler Indexes.

If you are working with page types anything added as part of form can be searched by appropriate settings in the page type searchable fields but not anything in the web parts.

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 14:21

it is a page crawler, I have another index with a page type, and it is working fine. and if by search result test you mean "search preview", then yes i have tried to inquire my search there but I am not getting any results, I am not sure if the content were entered within the Admin UI, because it is not my project originally, it was developed by others before me. Also please note that it is true that I have 1000+ index but the size is only 2MB!!

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 31, 2017 14:24

Farah, if you go to a page in the Page Application that you would like to show up in search result. Are there anything you can edit under the Page tab? Are they any content editable under the Form tab?

For the ASPX template, where are the content coming from? Dynamically generated via API, or from editable web parts? other something else.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 14:29

No thats what I meant when I said that it is not a web part structure, if we flip to to Page app, under Design tab, we cannot find anything to edit! we'll have to go to the Page Template app and get the File Name, and open this file in the visual studio, where we will find the HTML code.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 31, 2017 14:34

Can you take a screenshot of one of the aspx template from visual studio?

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 14:48 (last edited on October 31, 2017 14:55)

Image text

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 31, 2017 14:52

So, it looks like there is an issue with your scheduler as well as with the page crawler. Is the server able to access itself? The scheduler uses by default the /cmspages/scheduler.aspx page which is pinged to launch the scheduled tasks. The scheduler is not running since the index previously did not built.

Now, you told us you are using page crawler - the crawler has to access the site - so, the server has to listen to itself. Are you able to browse the web site when directly on the web server and using some browser?
Have you tried specifying the domain and user name for the page crawler?
When you use Fiddler or Wireshark, what requests do you see?
Are there any redirects set in the IIS or in your web site which may redirect the crawler requests?
Are the pages behind login?

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 31, 2017 15:06

The template you showed is likely a landing page which has Repeaters controls showing list of blog, news, etc. Can you go to the blog section of the site in Pages app? Each blog post should be entered within the content tree. Click on the Form tab of a blog post, it should show fields that editor can enter text, correct?

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on October 31, 2017 15:23

Rui Wang yes correct, what does that show?

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 31, 2017 15:34

That means the content should be indexed.

First, check page type app, find the type for the blog post, check the "Search fields" tab on the left side, are the blog text fields been checked for index? (https://docs.kentico.com/k10/configuring-kentico/setting-up-search-on-your-website/creating-search-indexes/defining-page-indexes)

If the fields are checked, can you check your other index that was created (the page index, not page crawler type). Make sure the indexed content include the blog section. Then use the search preview to see if you get any results.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on November 1, 2017 08:33

hi rui, I wanna let you know that I went over all of the transformations used in the project and enabled search for all text fields (that needs to be included in the search), and though the index file size has increased from 2 MB to 26 MB after rebuilding, but I still dont get any result when testing the search. Please provide me with a solution.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on November 1, 2017 10:32

Are you able to browse the web site when directly on the web server and using some browser? Have you tried specifying the domain and user name for the page crawler? When you use Fiddler or Wireshark, what requests do you see? Are there any redirects set in the IIS or in your web site which may redirect the crawler requests? Are the pages behind login?

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on November 1, 2017 11:15

hi juraj ondrus, to answer your first question, I am working locally, I didnt push my changes online yet. does it affect the search results if the project is running locally? and forgive me if I am being naiive but I didnt specify a domain and a username for the page crawler yet, also what do you mean by pages behind login?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on November 1, 2017 12:31

Well, it does not matter if it is online or locally. The web server is still behaving in the same way - so you need to ensure the page crawler invoked by Kentico can access the site - in other words, the server must be able to access itself internally.
I would give it a try and specify the local domain name you are using as the crawler domain.
Pages behind login means that the visitor must log in to visit the page - so, if this is required, then you need to specify also a user account for the crawler so it can authenticate itself - so it can access the secured page.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on November 1, 2017 12:46

ok so how to insure that the webserver can access itself? (suppose we are working locally) can you show me the steps please? and no I dont have pages behind login, the website is accessible by anyone.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on November 1, 2017 14:18

Farah, if this was an existing project, was the search working before handed over to you? Are there any colleague around you that may know little more about Kentico?

Also, you may want to consider use the official support channel by open a support ticket. Maybe you can provide a backup of the site to support so they can help you sort things out.

0 votesVote for this answer Mark as a Correct answer

Farah El Agha answered on November 1, 2017 16:09

problem solved after trying to manage the indexes online and not locally. indexes are rebuilding and returning correct results. thank you for your help.

0 votesVote for this answer Mark as a Correct answer

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