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 39 posts 109 karma points
    Apr 26, 2024 @ 09:54
    apload-gmbh
    0

    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:

    Umbraco.Content(Guid.Parse("12345678-1234-1234-1234-1234567891011"))
    .ChildrenOfType("blogEntry")
    .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:

Draft