Search code examples
dotnetnuke2sxc

2sxc Blog app search only index page 1


Using 2sxc Blog app, the DNN only indexes whatever is on first page of Blog page.

Second page onwards is not indexed, hence doesn't show in search results.

Can anyone help?


Solution

  • Thanks alot @iJungleBoy for help.

    For anyone else encountering this issues here's the solution:

    Amend the visual query to create another stream example "SearchIndex"

    enter image description here

    Once thats done, amend the query within your template which gets all the list items and has paging.

    @functions{
    
        // Prepare the data - get all categories through the pipeline
    
        public override void CustomizeData()
        {
    
        }
    
        /// <summary>
    
        /// Populate the search - ensure that each entity has an own url/page
    
        /// </summary>
    
        /// <param name="searchInfos"></param>
    
        /// <param name="moduleInfo"></param>
    
        /// <param name="startDate"></param>
    
        public override void CustomizeSearch(Dictionary<string, List<ISearchInfo>> searchInfos, ModuleInfo moduleInfo, DateTime startDate)
        {
    
             foreach (var si in searchInfos["SearchIndex"])
        {
            si.QueryString = "post=" + AsDynamic(si.Entity).UrlKey;
        }
        }
    }