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.
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.
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").
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?
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.
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.
Adam,
You can use TransformIndex event on examine to inject in content for the child pages that are used on parent page see https://our.umbraco.com/forum/umbraco-8/96172-v8-examinemanager-gatheringnodedata-how-to-with-latest-examine 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.
Regards
Ismail
Ismail,
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!
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?
is working on a reply...