How to create a search Action in Alfresco
Asked Answered
P

1

6

I am using Alfresco Enterprise 6.2. Similar to the live search, I am creating a search Action for folders that I have in document library.

I have updated the custom-actions.js as follows:

onActionSearch: function dla_onActionSearch(record){
        window.open(Alfresco.constants.PAGECONTEXT +'dp/ws/faceted-search?', "_self");       
}

I have also added folder scope in faceted-search.get.js as below. I have hardcoded the value folder1 just to test if it works:

  scopeOptions.push({
  id: "FCTSRCH_SET_FOLDER_SCOPE",
  name: "alfresco/menus/AlfCheckableMenuItem",
  config: {
    label: "folder",
    value: "folder1",
    group: "SEARCHLIST_SCOPE",
    publishTopic: "ALF_SEARCHLIST_SCOPE_SELECTION",
    checked: false,
    hashName: "scope",
    publishPayload: {
     label: "folder",
     value: "folder1"
    }
  }
});

However it dos not consider the folder scope when performing the search. Instead, it consider 'folder1' as a site. How can I correctly perform a search within folder scope?

Pepito answered 22/5, 2020 at 8:12 Comment(0)
S
2

Please check below widget,It is considering scope as a siteId always.

https://dev.alfresco.com/resource/docs/aikau-jsdoc/AlfSearchList.js_.html

Sandie answered 28/5, 2020 at 5:57 Comment(2)
Is extending AlfSearchList just enough or do I have to extend SearchService.js as well? Also, can I please know what's the best way to extend them?Pepito
You need to override SearchService.js and need to add logic of folder.Sandie

© 2022 - 2024 — McMap. All rights reserved.