Filter hits based on children

Vote:
 

I wonder if there is a good practice in Truffler/Find to do do a filter based on children to the pages that are hits?

For example: I want to search for all pages of a certain pagetype but I neeed to filter out the ones that has childrens of a certain type or has a certain property - it doesn't need to be realtime so the request can be to the index not the db.

Currently I am just asking for a maximum resultset and filter it out after the GetResult() but that is way to performance heavy since I need to ask for 1000 results (Or even do more requests since the max is 1000), do a filtering on my own and then prestent just the 10 first hits (It's a paged resultset).

#65966
Feb 15, 2013 22:32
Vote:
 

Aditional info:

We are using EPiServer 7 with update 1 and latest version of Find from EPiServer NuGet.

To clearify:

Is the best way to solve this by adding properties that calls GetChidren() and get the data from those children needed for the filter or is there a better way of doing it?

#65968
Feb 16, 2013 2:45
Vote:
 

Hi,

First, the index is almost "realtime". You could achieve this by adding a boolean extension method to your pages that you include when you are indexing the pages http://find.episerver.com/Documentation/dotnet-api-including-fields.

And you could also set dependencies to the pages, so if any of the child pages is updated, the parent is re-indexed too http://find.episerver.com/Documentation/episerver-cms7-integration-related-content

#65978
Edited, Feb 17, 2013 4:40
Vote:
 

That seem like a good solution, thank you! :)

#65979
Edited, Feb 17, 2013 5:54
Vote:
 

Damn Johan, you're getting too good at Find! Soon I have no reason to visit this forum ;-)

#65984
Feb 17, 2013 22:21
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.