AnsweredAssumed Answered

ADF search query to find nodes by tagNames

Question asked by pedrohernandez on Sep 7, 2018
Latest reply on Sep 10, 2018 by dvuika

Hello, thanks in advance for your help.

 

So, I've been working on a project base on demo-shell from GitHub - Alfresco/alfresco-ng2-components: Alfresco Angular Components , I need to find nodes on the live-search-bar also by looking by TagsNames. My nodes has tags and already in the share ui i can find them using the tagsname, but in my custom ui I cannot.

 

I asked this question on Alfresco/alfresco-ng2-components - Gitter , but they told me to come here and ask for help. They told me I have to implement my SearchConfigurationInterface. I have done it but I don't know how to modify it to look for tagsnames. here is my code.

 

export class TestSearchConfigurationService implements SearchConfigurationInterface {

    constructor() {
    }
    public generateQueryBody(searchTerm: string, maxResults: number, skipCount: number): QueryBody {
        const defaultQueryBody: QueryBody = {
            query: {
                query: searchTerm ? `${searchTerm}* OR name:${searchTerm}*` : searchTerm
            },
            include: ['path', 'allowableOperations'],
            paging: {
                maxItems: maxResults,
                skipCount: skipCount
            },
            filterQueries: [
                /*tslint:disable-next-line */
                { query: "TYPE:'cm:folder'" },
                { query: 'NOT cm:creator:System' }]
        };
        return defaultQueryBody;
    }
}

And in the search-extended.component I have    

providers: [
        { provide: SearchConfigurationService, useClass: TestSearchConfigurationService },
        SearchService
    ]
})

Outcomes