cancel
Showing results for 
Search instead for 
Did you mean: 

Seach in the repository by default in advanced search

thibault_l
Champ on-the-rise
Champ on-the-rise

Hello,

I created a custom advanced seach form : 

custom advanced form

It works as intended but the search is in "all sites" by default.

default

I would like to perfom all the advanced search in repository instead of all site : 

It's possible ? How can I do this?

I'm using Alfresco Community 5.2.

Thanks !

Update :

I found a solution that work for me : there is two files called advsearch.get.js in :

\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\search

\tomcat\webapps\ROOT\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\search

which contain :

 // config override can force repository search on/off
   model.searchScope = siteId || "all_sites";
   model.siteId = siteId;
   model.searchForms = searchForms;
   model.searchPath = "{site}dp/ws/faceted-search#searchTerm={terms}&query={query}&scope={scope}";

So I just replaced

   model.searchPath = "{site}dp/ws/faceted-search#searchTerm={terms}&query={query}&scope={scope}

by :

   model.searchPath = "{site}dp/ws/faceted-search#searchTerm={terms}&query={query}&scope=repo";

And restarted the server.

I don't know if the best solution but it's working !

2 REPLIES 2

redraccoon
Star Contributor
Star Contributor

J'ai pas la réponse exacte mais à mon avis c'est par rapport à l'url

si tu checks les arguments changent en fonction de ce que tu sélectionnes 

http://localhost:8081/share/page/dp/ws/faceted-search#searchTerm=a&scope=repo&sortField=Relevance

http://localhost:8081/share/page/dp/ws/faceted-search#searchTerm=a&scope=all_sites&sortField=Relevance

à mon avis il va falloir trouvé ou est généré l'url par ta recherche avancé et modifier l'argument avec une extension

 

Merci, je vais chercher de ce coté là et je mettrais à jour le message si je trouve une solution.