We have been trying to filter on different pagetypes with no luck.
What we do is create the query like this:
var query = _elasticSearchService
.Search<PageData>(model.SearchedQuery)
.Highlight()
.Language(culture);
and filter like this:
query = query.Filter(p => p.PageTypeName, "ReportPage");
The ReportPage class inherits from SitePageDate. It seems to work
When we try to filter like this we always get zero results.
We use query.getContentResults to get the results. We are able to see the PageTypeName from
the results in result.Hits where we can look at Content.PageTypeName for each hit.
We have also tested to see if the filter in general works, and it seems like it works to filter on for example name like this:
query = query.Filter(p => p.Name, "Testreportname");
Do you guys have any Idea what the root of the problem could be?
We have been trying to filter on different pagetypes with no luck.
What we do is create the query like this:
and filter like this:
query = query.Filter(p => p.PageTypeName, "ReportPage");
The ReportPage class inherits from SitePageDate. It seems to work When we try to filter like this we always get zero results.We use query.getContentResults to get the results. We are able to see the PageTypeName from the results in result.Hits where we can look at Content.PageTypeName for each hit.
We have also tested to see if the filter in general works, and it seems like it works to filter on for example name like this:
query = query.Filter(p => p.Name, "Testreportname");
Do you guys have any Idea what the root of the problem could be?