<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>
<repository-search>always-options</repository-search>
<repository-search>none</repository-search>
<#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>
Although you can solve the problem in this way, it's obviously not the recommended way and is certainly not future proof (against upgrade or installation of other modules).
Ideally you want to be creating an extension module to make this customization. This blog post provides an example of customizing widgets in the header (such as SearchBox). This would be the best approach to take for customizing search.
This blog post shows a fast way of creating extension modules for "full" Aikau pages like search.
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.