cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene indexer not including child aspect definitions

dbevacqua
Champ in-the-making
Champ in-the-making
I have a number of types which extend sys:container. I use aspects to specify what types of child association each type may have, since more than one type may have the same allowed child types.

Problem is, the Lucene index does not appear to contain anything for these fields (and possibly others):

PATH
ANCESTOR
ISCONTAINER

Looking at LuceneIndexerImpl.java, I see this:


// TODO: DC: Should this also include aspect child definitions?
                QName nodeTypeRef = nodeService.getType(nodeRef);
                TypeDefinition nodeTypeDef = getDictionaryService().getType(nodeTypeRef);
                // check for child associations

                if (includeDirectoryDocuments)
                {
                    if (nodeTypeDef.getChildAssociations().size() > 0)
                    {
                        if (directPaths.contains(pair.getFirst()))
                        {
                           

the code continues, adding the fields that I mentioned that are missing.

So I'm thinking the problem here is related to that TODO. From my (admittedly limited) scenario I can't see why you'd not want to include child associations from aspects, but maybe I'm thinking about them as too similar to interfaces.

Is part of the reason perhaps that you'd have to consider nodeTypeDef.getAspectDefinition().getChildAssociations() as well as just nodeTypeDef.getChildAssociations(), i.e. there could be a performance hit?

Am I looking in the right place here? Is this likely to change? It's really rather key to what we're doing, and would require a considerable reworking of our content model to fix.

Hope you can help.


Dominic
1 REPLY 1

andy
Champ on-the-rise
Champ on-the-rise
Hi

This section of code builds additional info used by the index for PATH queries.
It should check if the node type or any of the applied aspects to the node have children.

Rasied as
http://issues.alfresco.com/browse/AR-1040

Regards

Andy