Try our conversational search powered by Generative AI!

SearchDataSource in R2 does not returns files in the results

Vote:
 

Hi

I've made migration of a version 4.62 site to version 5.2.375.7 (EPiServer 5 R2) which is the latest version of EPiServer in the moment.
Migartion of the database and the files was made with the Migration Tool 1.1 and everything went fine. After that I upgraded the code of the application and again everything was OK until I tried to perform a search on the site.

Just to mention that in the old version I've used PageSearch control and now after the upgrade of the code, the same one was replaced with SearchDataSource and Repeater controls. When I tried to search only pages, the search worked perfectly. Then I tried to search for files and the result set was empty even though for the same search keyword with the old code I am getting results. I tried to find solution on the forum and took the folowing steps:

1. Checked that the Indexing service is running
2. Tried to perform search of files through File Managament in admin mode and it worked well, the result set was not empty
3. Tried to search with the property EnableVisibleInMenu on the SearchDataSource control, first set to true then to false...same result nothing returned.
4. Checked the IndexingService config file to see if the folders are set for indexing...they were.
5. Deleted the index folders in the VPP folders and reindexed them again...File Managament again worked fine but not the SearchDataSource.
6. Then I tried to debug with handling the Selected event on the SearchDataSource and got the following exception logged:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Web.WebControls.GenericDataSourceView`1.ExecuteSelect(DataSourceSelectArguments arguments) +350
   System.Web.UI.WebControls.Repeater.GetData() +36
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +214
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
   System.Web.UI.WebControls.Repeater.DataBind() +75
   System.Web.UI.WebControls.Repeater.EnsureDataBound() +55
   System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +16
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +202
   System.Web.UI.Control.PreRenderRecursiveInternal() +202
   System.Web.UI.Control.PreRenderRecursiveInternal() +202
   System.Web.UI.Control.PreRenderRecursiveInternal() +202
   System.Web.UI.Control.PreRenderRecursiveInternal() +202
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4586

These are my settings:

web.config:
<virtualPath customFileSummary="~/FileSummary.config">
   <providers>
    <clear />
    <add virtualPath="~/App_Themes/Default/" physicalPath="C:\Program Files\EPiServer\CMS\5.2.375.7\application\App_Themes\Default"
     name="App_Themes_Default" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
    <add virtualPath="~/secure/" physicalPath="C:\Program Files\EPiServer\CMS\5.2.375.7\application\UI"
     name="UI" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
    <add virtualPath="~/Util/" physicalPath="C:\Program Files\EPiServer\CMS\5.2.375.7\application\util"
     name="UtilFiles" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
    <add virtualPath="~/WebServices/" physicalPath="C:\Program Files\EPiServer\CMS\5.2.375.7\application\webservices"
     name="WebServiceFiles" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
    <add showInFileManager="false" virtualName="upload" virtualPath="~/upload/"
     bypassAccessCheck="false" physicalPath="C:\WebApps\RB\RB.Web.Vpp\upload"
     name="Siteupload" type="EPiServer.Web.Hosting.VirtualPathVersioningProvider,EPiServer" />
    <add showInFileManager="true" virtualName="Documents" virtualPath="~/Documents/"
     bypassAccessCheck="false" physicalPath="C:\WebApps\RB\RB.Web.Vpp\Documents"
     maxVersions="7" customFileSummary="~/summary.config" name="SiteDocuments"
     type="EPiServer.Web.Hosting.VirtualPathVersioningProvider,EPiServer" />
   </providers>
  </virtualPath>

IndexingService configuration:
<episerver.indexingService>
    <indexes>
      <add connectionString="Data Source=INXZZL;Database=dbRB_Main;User Id=ptkdbuser;Password=ptk99dbuser$;Network Library=DBMSSOCN;" databaseClient="" filePath="C:\WebApps\RB\RB.Web.Vpp\upload" itemRoot="/upload" />
      <add connectionString="Data Source=INXZZL;Database=dbRB_Main;User Id=ptkdbuser;Password=ptk99dbuser$;Network Library=DBMSSOCN;" databaseClient="" filePath="C:\WebApps\RB\RB.Web.Vpp\Documents" itemRoot="/Documents" />
      <add connectionString="Data Source=INXZZL;Database=dbRB_Main;User Id=ptkdbuser;Password=ptk99dbuser$;Network Library=DBMSSOCN;" databaseClient="" filePath="C:\WebApps\RB\RB.Web.Vpp\Global\" itemRoot="/Global" />
      <add connectionString="Data Source=INXZZL;Database=dbRB_Main;User Id=ptkdbuser;Password=ptk99dbuser$;Network Library=DBMSSOCN;" databaseClient="" filePath="C:\C:\WebApps\RB\RB.Web.Vpp\PageFiles\" itemRoot="/PageFiles" />
    </indexes>
  </episerver.indexingService>

And here are some of the setting that I give to the SearchDataSource in codebehind:
epiSearchSource.PageLink = PageReference.StartPage;
epiSearchSource.PageLinkProperty = "MainContainer";
epiSearchSource.SearchLocations = "~/Global/,~/Documents/,~/PageFiles/,~/upload/";
epiSearchSource.Selected += HandleErrors;
epiSearchSource.Selected += HandleEmptyResult;

Does anybody knows what the problem might be or this is a bug in the new EPiServer release?

 

#26831
Dec 26, 2008 13:06
Vote:
 
#26835
Dec 29, 2008 14:35
Vote:
 
Have a look at this blog post:
http://labs.episerver.com/en/Blogs/Tore-Gjerdrum/Dates/2008/9/Problems-with-SearchDataSource-and-EnableVisibleInMenu/
#26863
Jan 05, 2009 10:03
Vote:
 
And these posts:
http://world.episerver.com/Forum/Pages/thread.aspx?id=20353
#26864
Jan 05, 2009 10:09
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.