cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to disable suggestion in alfresco

hiten_rastogi1
Star Contributor
Star Contributor
Hi All,

I am trying to disable suggestion functionality for one of our client but so far I am unsuccessful in achieving it. I have tried the following to make it work.

1. Stop Alfresco server.
2. Set to false the property <strong>solr.suggester.enabled=false</strong> in <strong>solrcore.properties</strong> under {SOLR_HOME}/workspace-SpacesStore/conf. For       reference http://docs.alfresco.com/5.0/concepts/solr4-considerations.html
3. Rebuild indexes http://docs.alfresco.com/5.1/tasks/solr-reindex.html
4. Start Alfresco.


I have also tried the above steps with solrconfig.xml file, changing the property directly, under {SOLR_HOME}/workspace-SpacesStore/conf, but still no succcess. Below is the snippet of the xml.


<searchComponent name="suggest" class="org.alfresco.solr.component.AsyncBuildSuggestComponent">
    <lst name="suggester">
      <str name="name">shingleBasedSuggestions</str>
      <str name="enabled">${solr.suggester.enabled:false}</str>
      <!– <str name="lookupImpl">org.apache.solr.spelling.suggest.jaspell.JaspellLookupFactory</str> –>
      <str name="lookupImpl">org.apache.solr.spelling.suggest.fst.WFSTLookupFactory</str>
      <str name="field">suggest</str>
      <str name="suggestAnalyzerFieldType">text_shingle</str>
      <str name="buildOnCommit">false</str>
    </lst>
  </searchComponent>

  <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="suggest">false</str>
      <str name="suggest.count">10</str>
      <str name="suggest.dictionary">shingleBasedSuggestions</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>


Can anyone please help me out in this ??


Thanks
Hiten Rastogi
12 REPLIES 12

angelborroy
Community Manager Community Manager
Community Manager
In 5.0.d there is no centralized configuration for that.

You can overwrite the views for all repository web scripts to return empty lists

/alfresco/templates/webscripts/org/alfresco/slingshot/search/live-search-docs.get.json.ftl<code>
<code>/alfresco/templates/webscripts/org/alfresco/slingshot/search/auto-suggest-search.get.json.ftl<code>
<code>/alfresco/templates/webscripts/org/alfresco/slingshot/search/live-search-people.get.json.ftl<code>
<code>/alfresco/templates/webscripts/org/alfresco/slingshot/search/live-search-sites.get.json.ftl<code>

For instance, for the first one, include a new file located at <code>/opt/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/live-search-docs.get.json.ftl with the following content:



<#escape x as jsonUtils.encodeJSONString(x)>
{
   "totalRecords": 0,
   "startIndex": 0,
   "hasMoreRecords": "false",
   "items":
   [
   ]
}
</#escape>

Hyland Developer Evangelist

Thanks Angel Borroy for your help.

Thanks Angel Borroy for your help.

I have found these files at /Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.d/alfresco/templates/webscripts/org/alfresco/slingshot and any changes I make to them are not reflecting on the application.

Could let me know how to remove the people finder from  the live search? and How to override them so changes reflect on application?

Thanks

afaust
Legendary Innovator
Legendary Innovator

You should not change those files directly. Instead, use the shared/classes/alfresco/extension path to override them, i.e. via the path shared/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/

thanks for your useful info.

I have overrided live-search-people.get.json.ftl file as the way you mentioned and people suggestion is not coming which is good but now no suggestion is coming at all, i.e., no document/file suggestion.

Also how can I change the placeholder of search box? I want it to be "Search files,sites" only.

Any idea?

mbajpai
Confirmed Champ
Confirmed Champ

Please see this link , it has all the information about the search box -

JSDoc: Module: alfresco/header/SearchBox 

nwali
Star Contributor
Star Contributor

I had came across this document but couldn't find it in alfresco community.

Where could I find this file in alfresco community? Could you share the path for it?

Also how to override this file?

Thanks.

afaust
Legendary Innovator
Legendary Innovator
Since this has been asked in IRC today as well, I took the time to look into it.

The feature "did you mean" in faceted search is actually called "spellcheck" which is unrelated to the suggester config, although it uses the same index fields / values. It can be disabled by configuring the AlfSearchList module with the config property "spellcheck" set to false. This is best be done in a Surf extension module that adds a customization to faceted-search.get.js

The SOLR suggester is only used for a type-ahead convenience functionality when entering search terms in the keyword input field. It is actually properly disabled by setting the solr.suggester.enabled property in solrcore.properties to false. Additionally, there is also a separate property that can be set in alfresco-global.properties with the same name to disable only the Repository-tier service. Both have the same effect of disabling the type-ahead.

Regards
Axel