Search widget does not enable searches inside content blocks
I'm trying to use the sitefinity search widget but it doesn't work correctly.
I've checked the "Static HTML in pages" option in search indexes page. I then reindexed it. The search result page doesn't display words which are in content blocks. Can you help me find a solution?
Thanks for using Sitefinity.
I am not able to replicate this on any version of Sitefinity.
You can see a live demo here. Screenshots of the set up are attached.
Are you calling any code that uses session variables? This causes search to break on those pages because the HTTPContext returns null to the indexer.
Thank you for reply.
We don't use any Session, ViewState or HttpContext parameters in code behind. We haven't found a solution yet.
What else should I look out for?
Might be dumb question, but on the search widget you did set which index to be used and were to display.
Yes, i set all of them. Search widget is searching and displaying results in documents, user control, menu titles.
Just problem is search widget doesn't search static html on content blocks in all of pages.
Can you please go to your App_Data/Sitefinity/Logs folder, and temporarily move/remove all generated logs (you might need to stop the worker process for this site as it puts a lock on some of the logs). Afterwards please reindex the search index that contains Static HTML on pages in its settings, and let us know if any logs have been generated.
The most common reason for the experienced issues is that the pages cannot be rendered internally for indexing, as there's a control on them that throws an exception when the page is rendered in index mode (e.g. calls to SiteMapBase.getActualCurrentNode() or using Session).
the Telerik team
I have tried same as you mentioned above.But still its not able to search Static HTML on content blocks.No any Logs error occure.
Could you please suggest me another solution?
Our suggestion is to try recreating the search index. Remove the search index, delete the search index folder from App_Data -> Sitefinity -> Search and finally recreate the search index again.
If the problem still persist please open a support ticket and provide us with a link to your web site and backend credentials to investigate the problem deeply.
The problem is probably the problem I think I'm having now. I disable 'static' in the search index, but enable 'contentblock' thinking this will only search the content blocks in the pages and not the surrounding text (ie, template stuff). What I do to fix this (unfortunatly) is click 'share' on the content blocks to make them show up in the 'content blocks' under modules.
So, just curious, is this intended? It appears that only 'shared content blocks' are search and not content blocks in pages. If this is the case, change the option for the search index from 'content blocks' to 'shared content blocks'. or rename the content blocks that are in pages but not shared.... bit confusing.
When you define Content Blocks scope to be indexed the search will index all content blocks that are created in the Content Blocks section which is available under Content and that are shared. This is the default behavior of Sitefinity.
If you want to index the content of the content blocks that are dropped on a page and you have entered some html the only option is to select Static HTML in pages type of content which will be indexed, because the content blocks created on the pages are generic content widgets.
1. Go to the backend of your project.
2. Select Administration -> Search and Indexes.
3. Open your search index and select Static HTML in pages in the Scope section.
I got the error of Object Refrences when reindex the Search index
plz reply as soon as possible