cancel
Showing results for 
Search instead for 
Did you mean: 

Differend query result search service and nodebrowser

glaenen
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to make a quartz scheduled job to compare md5 hashes on nodes.
When trying to select all the nodes containing my md5 aspect I notice that

ResultSet results = serviceRegistry.getSearchService().query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_SOLR_CMIS , "SELECT * FROM cmc:md5Aspect");

only returns the cm:documents containing the md5 aspect while running the
same query from the node browser returns all the nodes containing this aspect.
I have tried this with lucene using ASPECT:"cmc:md5Aspect" and I get the same result,
only cm:content nodes are returned while the node browser returns all documents.

Am I using searchservice in a wrong way or could this be a bug in 4.0c?

Thanks,

Glenn
6 REPLIES 6

anujs86
Champ in-the-making
Champ in-the-making
use search query as SearchService.LANGUAGE_LUCENE

glaenen
Champ in-the-making
Champ in-the-making
I just found out that that using AuthenticationUtil.runAsSystem(runAsWork) is causing my problem.
When switching to AuthenticationUtil.runAs(runAsWork, "some admin"); all the nodes with the cmc:md5Aspect are in the resultset.
And this for both the cmis and the lucene query.

My guess was that runAsSystem gives me access to all nodes?

mitpatoliya
Star Collaborator
Star Collaborator
Well Its always better you set current user as admin while firing the query.
As admin has access to all the content you will get all possible contents in result set.
Otherwise it will filter out internally based on the role of current user.

glaenen
Champ in-the-making
Champ in-the-making
Isn't AuthenticationUtil.runAsSystem(some code) supposed to fire the query whit a user that has all the access rights needed?
It seems to me that AuthenticationUtil.runAsSystem(some code) should be basically the same as AuthenticationUtil.runAs(some code,  admin)

mitpatoliya
Star Collaborator
Star Collaborator
The Authentication API's are updated mostly with each version.
Could please specify which version you are using?

glaenen
Champ in-the-making
Champ in-the-making
I'm using 4.0.d.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.