Examine - search child nodes to return parent nodes
Hi All,
I am trying to return a list of nodes by querying child nodes.
For example my content is like so (node alias in brackets):
Trips:
Cruising the River Kwai (Trip)
Hanoi (Related Location)
Vietnam (Related Location)
River Kwai (Related Location)
3 Day Tour round Bangkok (Trip)
Bangkok (Related Location)
Thailand (Related Location)
Cycling in Battambang (Trip)
Vietnam (Related Location)
Battambang (Related Location)
I am aiming to return a list of trips say on a country or city page; i.e. have a Vietnam page that would list out the first and last trip. So I need to query the Related Locations to return a unique list of trips that are relevant.
I have this working using the IPublishedContent interface, but it is slow (even for a handful of trips).
Is anyone able to give me some pointers as to how to construct an Examine search work for this?
Examine - search child nodes to return parent nodes
Hi All,
I am trying to return a list of nodes by querying child nodes.
For example my content is like so (node alias in brackets):
Trips:
I am aiming to return a list of trips say on a country or city page; i.e. have a Vietnam page that would list out the first and last trip. So I need to query the Related Locations to return a unique list of trips that are relevant.
I have this working using the IPublishedContent interface, but it is slow (even for a handful of trips).
Is anyone able to give me some pointers as to how to construct an Examine search work for this?
Thanks! Adam
Hi Adam
I think that xPath is your friend in this situation, please, have a look at "Common Pitfalls" article - https://our.umbraco.org/documentation/reference/Common-Pitfalls/#xpathnodeiterator-for-when-you-need-direct-xml-support
You can query Trips with xPath like it's described in the article
Thanks,
Alex
Hi Adam
Did you solve the issue? Please, share with community/
Oleksandr
is working on a reply...