cancel
Showing results for 
Search instead for 
Did you mean: 

DynamicCollectionProcessor query not finding collectiions

schipmolder
Champ on-the-rise
Champ on-the-rise
Hi,

I've been trying to figure this one for a while now, but can't figure out why this isn't working.
I'm basically using a default community server with alfresco 4.0.d and web quick start and the DynamicCollectionProcessor of web quick start just never seems to find any dynamic collections to consider updating.

I did notice two other posts of users with similar problems, but they both got exceptions that indicated the collections were found but errored during updating.
In my case the lucene query just never seems to find any collections, but when I run the same query in the node browser it does find them all.

The query it runs is + TYPE:"ws:webassetCollection" + @ws\:isDynamic:true

Unlike the other users with similar issues I don't get any errors or exceptions (ive got debug logging enabled for the module), but the searchservice just returns an empty resultset…

Does anybody know why it wouldnt find any collections and what I can do to resolve this?

Thanks
Skip
2 REPLIES 2

schipmolder
Champ on-the-rise
Champ on-the-rise
Ok, I finally found that the searchService only seems to find objects with types from the contentmodel, but not when it's type is from the website model.

To test this I've setup a number of searches and all only return the objects from the content model.


ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "TYPE:\"{http://www.alfresco.org/model/website/1.0}webassetCollection\"");
log.debug("{http://www.alfresco.org/model/website/1.0}webassetCollection -> " + rs.length());

rs = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "TYPE:\"{http://www.alfresco.org/model/website/1.0}article\"");
log.debug("{http://www.alfresco.org/model/website/1.0}article -> " + rs.length());
                       
rs = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "TYPE:\"{http://www.alfresco.org/model/content/1.0}folder\"");
log.debug("{http://www.alfresco.org/model/content/1.0}folder -> " + rs.length());

rs = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "@cm\\:name:\"collections\"");
log.debug("@cm\\:name:\"collections\" -> " + rs.length());

rs = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "ID:workspace\\://SpacesStore/e59a0792-f436-46a4-b42a-a46f235dcc31"); // A website article node
log.debug("ID:workspace\\://SpacesStore/e59a0792-f436-46a4-b42a-a46f235dcc31 -> " + rs.length());

With output:


2012-08-16 22:57:00,018  DEBUG [org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor] [DefaultScheduler_Worker-3] {http://www.alfresco.org/model/website/1.0}webassetCollection -> 0
2012-08-16 22:57:00,029  DEBUG [org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor] [DefaultScheduler_Worker-3] {http://www.alfresco.org/model/website/1.0}article -> 0
2012-08-16 22:57:00,047  DEBUG [org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor] [DefaultScheduler_Worker-3] {http://www.alfresco.org/model/content/1.0}folder -> 66
2012-08-16 22:57:00,058  DEBUG [org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor] [DefaultScheduler_Worker-3] @cm\:name:"collections" -> 0
2012-08-16 22:57:00,062  DEBUG [org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor] [DefaultScheduler_Worker-3] ID:workspace\://SpacesStore/e59a0792-f436-46a4-b42a-a46f235dcc31 -> 0
2012-08-16 22:57:00,115  DEBUG [org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor] [DefaultScheduler_Worker-3] {http://www.alfresco.org/model/content/1.0}content -> 131

To illustrate, when I run the query TYPE:"{http://www.alfresco.org/model/content/1.0}content" in the node browser I get 512 results, but the search service only sees 131, all with a type from the content model.

Can anyone think of a reason why this would happen?
Bear in mind, the website model is defined in the same module and all the rest seems to work ok…

schipmolder
Champ on-the-rise
Champ on-the-rise
Ok, I finally managed to fix this and thought I'd put my solution here in case others have the same issue.

I started off with installing a new alfresco server to see if I'd have the same issue there, but that all worked normally and the collections were all found.
I then noticed that on both servers only the scheduled jobs had the issue of not seeing any website objects, but the normal webscripts seemed to be unaffected.

As the jobs all run as the AuthenticationUtil.SYSTEM_USER_NAME user I figured this could also be a weird permission thing where the user running the job just doesn't have access to the site root.
It turned out that one of my colleagues had changed the admin user's password (he had also changed this in the was wepapp so that could still communicate with the alfresco backend) so I figured it could have something to do with that.

Long story short, when I changed AuthenticationUtil.SYSTEM_USER_NAME to "admin" suddenly all came back to life!


        AuthenticationUtil.runAs(new RunAsWork<Object>()
        {
            @Override
            public Object doWork() throws Exception
            {
                transactionService.getRetryingTransactionHelper().doInTransaction(
                        new RetryingTransactionCallback<Object>()
                {
                    @Override
                    public Object execute() throws Throwable
                    {
                       …
                       …
                    }  
                });
                return null;
            }
        }, AuthenticationUtil.SYSTEM_USER_NAME);

I have absolutely no idea why the System (= AuthenticationUtil.SYSTEM_USER_NAME) user wouldn't have access to the site's root whereas admin does but it works.
If anyone has any ideas why this happens then please let me know, but I'm just happy it works again.
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.