Customize SearchComponent to search in a specific folder

cancel
Showing results for 
Search instead for 
Did you mean: 
olesea
Active Member

Customize SearchComponent to search in a specific folder

Hello I want to search in Sites folder and I have tried to make my custom Query, but it is not working. I am sure I am doing something wrong , but I do not know whatSmiley Sad

I attached the query builder, can anyone help me with that?

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:quotemark
{ query: "TYPE:'cm:folder' OR TYPE:'cm:content'" },
{ query: 'NOT cm:creatorSmiley Frustratedystem' },
{ query: ' PARENT:\'workspace://SpacesStore/Company Home/Sites\'' }
]
};

return defaultQueryBody;
}

 Thank you.

1 Reply
eugenio_romano
Alfresco Employee

Re: Customize SearchComponent to search in a specific folder

Hi 

Maybe here you can find more information:

https://docs.alfresco.com/4.0/concepts/rm-searchsyntax-intro.html