Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Having trouble with a filter

$
0
0

When searching I only want to get pages in specific branches of the page tree.

This works fine:

myQuery.Filter(x => x.Ancestors().Match("48"))

But shouldn't this give the same result?

var pageBranchFilter = SearchClient.Instance.BuildFilter<IContent>();
pageBranchFilter.Or(x => x.Ancestors().Match("48"));
myQuery.Filter(pageBranchFilter);

The second approach is completely ignored when doing the search.


Viewing all articles
Browse latest Browse all 6894

Trending Articles