Our search results must depend on what part of the tree is now user.
How should we configure search request to search under specific content reference?
Search result should includes root page (provided as content reference to request) and children pages.
you could filter on ancestors:
.Filter(x => x.Ancestors().Match(somePage.ContentLink.ID))
Or if you use UnifiedSearch you could/should use:
.Filter(x => !x.MatchTypeHierarchy(typeof(PageData))
Henrik Fransas I have several question according to your code:
1) Do you know where this code will be executed (EPiServer application OR EPiServer Find server)?
2) Is Filter always to be performed on the application side or search side?
3) I saw that 'Ancestors' property presents in the EPiServer Find index.
Is it possible to add filter to search request by property name without type conversion?
1. EPiServer Find server
2. Search side
3. Don't worry about the type conversion. It will never actually be invoked, as the Find search query will only look at the Field Name, which is "Ancestors" in this case. This also means that the "Ancestors" method will only be invoked when you index the content, and never when running the query. When the query is run, it will look for a property with the same name (Ancestors) in the index.
Thanks guys for your answers