Hi everyone.
i have implemented content modules for a website running Umbraco V11. The content modules is created using blocklists and there is nested blocklists as well for some of the items. I am trying to implement a searchpage that also includes searching the nested content blocklist items text fields.
i have implemented a basic search using the official documentation and it is working, but is only working on Page properties like Page bodyText. All the content in the blocklist of the page is not indexed or available.
i dont see anything in the documentation about searching nested content, but if anyone could give me some hints on how to solve this would be great.
here is a codesnippet form SeachContentNames function in my searchService:
public IEnumerable<IPublishedContent> SearchContentNames(string query) {
IEnumerable<string> ids = Array.Empty<string>();
var textFields = new[] { "nodeName", "description", "content"};
if (!string.IsNullOrEmpty(query) && _examineManager.TryGetIndex("ExternalIndex", out IIndex? index)) {
ids = index
.Searcher
.CreateQuery("content")
.NodeTypeAlias("page")
.Or()
.NodeTypeAlias("home")
.And()
.Field("nodeName", query)
.Execute()
.Select(x => x.Id);
}
foreach (var id in ids) {
yield return _umbracoHelper.Content(id);
}
}
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/112761-searching-nested-blocklist-content-in-examine-search