Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • apload-gmbh 37 posts 107 karma points
    Apr 26, 2024 @ 09:54

    Text Search in Grid-Content

    Hi everyone

    We have implemented a text search for the blog post and it works perfect for the blog title (text input) and blog teaser text (textarea), but not yet for the content in the grid layout (blogtext). The problem is that it finds also HTML-Tags, as well as JSON values like the GUID value, alias value, config value...

    The query looks like:

    .Where(x => x.IsVisible())
    .Where(z => z.Value<IEnumerable<IPublishedContent>>("Categories").Where(b => categorie_Ids.Contains(b.Id.ToString())).Any())
    .Where(z => z.Name.Contains(searchStr) || z.Value("blogTeaser").ToString().Contains(searchStr) || z.Value("blogText").ToString().Contains(searchStr))
    .OrderByDescending(o => o.Value<DateTime>("date"));

    Can anyone point us in the right direction?

    Thanks Jan

Please Sign in or register to post replies

Write your reply to: