Kooboo 加Search功能 必须先ReBuild Index Data

时间:2023-02-10 20:30:20
 
加Search功能
 
有几个要点
1. 需要在Kooboo 必须先 ReBuild Index Data
2. 需要在要搜索的page中启用搜索索引
 
Kooboo 加Search功能 必须先ReBuild Index Data
 
 
Kooboo 加Search功能 必须先ReBuild Index Data
 
搜索的代码
@using Kooboo.CMS.Content.Models
@using Kooboo.CMS.Search
@{ var result = Repository.Current.Search("Dolor", 1, 10); }
@result.TotalItemCount
@foreach (var item in result)
{
    <p>@item.Title @item.HighlightedTitle</p>
    <p>@item.HighlightedBody</p>
}
 
 
Did you have add the search index setting, the search index setting must to add to enable the content indexing.