Help shape the future of CMS PaaS release notes! Take this quick survey and share your feedback.
Help shape the future of CMS PaaS release notes! Take this quick survey and share your feedback.
This may depend on your site settings, how is the default site setup in site management?
E.g.
Thanks for your answer, this is what the site settings look like:
Any suggestion what to change?
Thanks,
Magnus
Can "everyone" authenticated (I assume Authenticated Users) access the site since it is an Intranet?
Assuming that searches always will be in authenticated context have you implemented AccessControlListQuery. Ted Nygren wrote this a while ago that maybe will help you out, Add custom fields to the EPiServer Search index with EPiServer 7 - ted&gustaf
The cleaned up version would look like this
public IEnumerable<T> Search<T>(string keywords) where T: IContent
{
// We'll combine several queries and all must match
var query = new GroupQuery(LuceneOperator.AND);
// Only search for content of type T
query.QueryExpressions.Add(new ContentQuery<T>());
query.QueryExpressions.Add(new FieldQuery(keywords));
// Only search for content the current user has permission to read
var accessQuery = new AccessControlListQuery();
accessQuery.AddAclForUser(PrincipalInfo.Current, HttpContext.Current);
query.QueryExpressions.Add(accessQuery);
// Perform search
var searchHandler = ServiceLocator.Current.GetInstance<SearchHandler>();
var results = searchHandler.GetSearchResults(query, 1, int.MaxValue);
var contentSearchHandler = ServiceLocator.Current.GetInstance<ContentSearchHandler>();
// Convert search result to pages
return results.IndexResponseItems.Select(contentSearchHandler.GetContent<T>);
}
Try adding the ACL-stuff to your searches and see if that resolves the issue
Thanks for the hint in right direction, I got it working by setting specific roles access like this:
accessRightsQuery.AddRole(EveryoneRole.RoleName);
accessRightsQuery.AddRole(AuthenticatedRole.RoleName);
and skipped this part:
accessRightsQuery.AddAclForUser(context);
/M
I have an issue with viewing lucene content search results on a site with windows authentication. It seems like I can see results on the search page when I have WebEditors or WebAdmins access right. But I cant see the search result when i'm an Everyone user. Does anyone know why?
Im using the github episerver content search lucene project as search service