cancel
Showing results for 
Search instead for 
Did you mean: 

Disable search by content on Alfresco share

sofia
Champ in-the-making
Champ in-the-making
Hello,
How can I disable search by content in Alfresco Share ? what are the files I should modify ?
(I'm not talking about advanced search)

Thank you
2 REPLIES 2

sofia
Champ in-the-making
Champ in-the-making
Please do you have any idea about how to disable serach by content on alfresco 4.2.e ?

s_palyukh
Star Contributor
Star Contributor
Hi.

You can patch search.get.js (/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search):




<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.lib.js">
function main()
{
   var params =
   {
      siteId: (args.site !== null) ? args.site : null,
      containerId: (args.container !== null) ? args.container : null,
      repo: (args.repo !== null) ? (args.repo == "true") : false,
//      term: (args.term !== null) ? args.term : null,
      term: (args.term !== null) ? "@cm\\name:\"" + args.term + "\"" : null,
      tag: (args.tag !== null) ? args.tag : null,
      query: (args.query !== null) ? args.query : null,
      rootNode: (args.rootNode !== null) ? args.rootNode : null,
      sort: (args.sort !== null) ? args.sort : null,
      maxResults: (args.maxResults !== null) ? parseInt(args.maxResults, 10) : DEFAULT_MAX_RESULTS,
      pageSize: (args.pageSize !== null) ? parseInt(args.pageSize, 10) : DEFAULT_PAGE_SIZE,
      startIndex: (args.startIndex !== null) ? parseInt(args.startIndex, 10) : 0
   };
  
   model.data = getSearchResults(params);
}

main();




I didn't test it, but I believe it should work correctly to search by doc name.