Copied to clipboard

Flag this post as spam?

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

  • Adam Werner 15 posts 166 karma points c-trib
    Dec 18, 2019 @ 18:26
    Adam Werner

    Examine search return parent page rather than child

    I'm working on returning some search search results in v8 where I have a parent page ("Business and Institutions") that draws a child page ("Services") into itself because its a more a specialized component rather than a true page.

    enter image description here

    In searching, the "Services" page comes back in the results and that does make sense. However, the ideal result for user output would be to display the "Business and Institutions" page for that content found in the "Services" page as its being pulled into the page display of the "Services" page.

    Anyone ever have to show search results in a content structure like this before?

    To suppress the "Services" page, I can be sure not to present that document type in the search results. For the "Business and Institutions" page, the approach I'm thinking of taking is to tuck the "Services" content into a property in the "Business and Institutions" page and, with that being indexed, it would come back in the user presented search results.

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Dec 19, 2019 @ 08:08
    Ismail Mayat


    You can use TransformIndex event on examine to inject in content for the child pages that are used on parent page see also you will need to update your search query to search over the new injected field but also to ignore any types that are of type child page.



  • Adam Werner 15 posts 166 karma points c-trib
    Dec 21, 2019 @ 02:54
    Adam Werner


    Thank you for your help. I reviewed the forum thread you suggested and was able to attache a handler for the TransformingIndexValues event.

    To access the child page ("Services"), I used the UmbracoContextFactory and read the necessary properties on that child page to store them in a new, injected field in the ValueSet of the parent page ("Business and Institutions").

    Thank you again for your help!

  • Zaki Naeem 2 posts 72 karma points
    Nov 13, 2020 @ 22:51
    Zaki Naeem

    Hi Adam - am a little late to the party, but the situation you had is exactly what I am trying to get around myself. I was wondering if you ended up with a solution that also updates the indexed value for “parent” when a “child” note is updated? Because without that the indexed values for parent would be out of sync?

Please Sign in or register to post replies

Write your reply to: