cancel
Showing results for 
Search instead for 
Did you mean: 

Make default search only AllSites

johnny_k
Confirmed Champ
Confirmed Champ
Hello everyone!
How I can change default search Repository in share and make default search in AllSites only.
Try Use tutoril:
http://docs.alfresco.com/community/tasks/filtered-search-custom.html


but nothing changed Smiley Sad 
1 ACCEPTED ANSWER

johnny_k
Confirmed Champ
Confirmed Champ
ok iam make it
1.   download file aikau-1.0.63.jar
2.   unzip file
3.   path:
•   aikau-1.0.63\META-INF\js\aikau\1.0.63\alfresco\header\

4.   Edit file SearchBox.js:
•   find RAW: selectedScope: "repo" and change it
•   selectedScope: "all_sites"

open archive aikau in winrar: go path META-INF\js\aikau\1.0.63\alfresco\header
and add new file in archive.
copy new file to /opt/alfresco/tomcat/webapps/share/WEB-INF/lib/
restart server and WORK !!!!!!

View answer in original post

11 REPLIES 11

gawadesk
Star Contributor
Star Contributor
Just trying to understand context of your question.

So you want unable search only for site content and want to disable for other repository content. Is this your question?

Thanks,
Krishna

Hi!
yes, you are exactly right ! or just change default search filter on AllSites,
look image

You have do repository-search as 'none' to disable repository wide search option. You have to do this changes in your share-config.xml file.

Alternatively you can do changes in your share-config-custom.xml so it will be easier for future upgrade and changes.



<config evaluator="string-compare" condition="Search">
<search>
<!–  default minimum length for search terms  –>
<min-search-term-length>1</min-search-term-length>
<!–  default maximum number of results for a search  –>
<max-search-results>250</max-search-results>
<!–  default maximum number of results for user search  –>
<max-users-search-results>20</max-users-search-results>
<!–  Repository search configuration option  –>
<!–

              The 'repository-search' config element value can be one of:
              none - disable repository wide search option
              context - search depending on current context, including repository, all sites, current site (default)
              always - always search full repository no matter what the context, disables search context options
              always-options - always search full repository no matter what the context, still shows the search context options
        
–>
<repository-search>always-options</repository-search>
<!–
default option to display filter pane. Override if solr1 is used.
–>
<display-facets>true</display-facets>
</search>
<!–  sorting fields and labels  –>
<!–

         The 'sort' config element contains the name of the content model field
         to sort against and can be of the form:
          . Short QName string e.g. "cm:name"
          . Pseudo cm:content field starting with a "." e.g. ".size"
          . Any other valid sortable fts-alfresco special field e.g. "TYPE"
         The field can be optionally followed by |true or |false to indicate sort direction,
         where true = ascending, false = descending
        
         The element supports the following optional attributes:
            label = label text to display
            labelId = I18N message id of label text to display
            isSortable = true or false for if the field contains sortable data
     
–>
<sorting>
<sort labelId="search.sort.relevance" isSortable="false"/>
<sort labelId="label.name" isSortable="true">cm:name</sort>
<sort labelId="label.title" isSortable="true">cm:title</sort>
<sort labelId="label.description" isSortable="false">cm:description</sort>
<sort labelId="label.author" isSortable="false">cm:author</sort>
<sort labelId="label.modifier" isSortable="true">cm:modifier</sort>
<sort labelId="label.modified" isSortable="true">cm:modified|false</sort>
<sort labelId="label.creator" isSortable="true">cm:creator</sort>
<sort labelId="label.created" isSortable="true">cm:created|false</sort>
<sort labelId="search.sort.size" isSortable="true">.size|true</sort>
<sort labelId="search.sort.mimetype" isSortable="true">.mimetype</sort>
<sort labelId="search.sort.type" isSortable="true">TYPE</sort>
</sorting>
</config>



Let me know if this solve your problem.

1. step edit share-config-custom.xml:
add your code and mark
<repository-search>always-options</repository-search>
as
<repository-search>none</repository-search>

restart alfresco
nothing, repo as default filter always

2. step edit share-config.xml
<repository-search>none</repository-search>

restart alfresco
nothing, repo as default filter always
Smiley Sad

ddraper
World-Class Innovator
World-Class Innovator

The configuration you're referring to here relates to pre-5.0 versions of Share. Changing this configuration won't solve the problem. See the answers further down for the correct solution.

gawadesk
Star Contributor
Star Contributor
It should work. Did you cleared all cached data before restarting ?

If nothing work check for your 'search.get.html.ftl' located in share application at alfresco/site-webscripts/org/alfresco/components/search/.

Check for below section and remove manually things which is not needed but this is workaround not the ideal approach.


      <#assign searchconfig=config.scoped['Search']['search']>
      <div id="${el}-body" class="search">
         <#assign context=searchconfig.getChildValue('repository-search')!"context">
         <#if searchQuery?length == 0 && context != "always">
         <div class="search-sites">
            <span <#if context == "none">class="hidden"</#if>><a id="${el}-repo-link" href="#" <#if searchRepo>class="bold"</#if>>${msg('message.repository')}</a></span><#if context != "none"> |</#if>
            <a id="${el}-all-sites-link" href="#" <#if searchAllSites && !searchRepo>class="bold"</#if>>${msg('message.allsites')}</a>
            <#if siteId?length != 0>| <a id="${el}-site-link" href="#" <#if !searchAllSites && !searchRepo>class="bold"</#if>>${msg('message.singlesite', siteTitle)?html}</a></#if>
         </div>
         </#if>

wow….nope, how i can make clear all cached?

Stop alfresco and delete all content from below directory and start server.

tomcat/temp/
tomcat/work/

i make all changes what you say and nothing. Dellete folders
tomcat/temp/
tomcat/work/

try use another :
- browser
- computer
- user
and every time repo filter as default for search.