cancel
Showing results for 
Search instead for 
Did you mean: 

Adjust default search/quicksearch custom attribute

dhartford
Champ on-the-rise
Champ on-the-rise
Hey all,
I'm currently trying to use the community edition (3.4.d) to see if it would be an alternative to a couple of existing solutions.

Question on the Share piece: is it possible to change the default 'search' field (the quick search one) to include custom attributes?  I got as far as http://wiki.alfresco.com/wiki/Full_Text_Search_Query_Syntax, but not sure if this is the right place or not, or if/how to add the customization (I would hope share-config-custom.xml, but not sure).

I have the Advanced Search/Form level searching fine, however due to the volume of use in certain scenarios I want the default search to use some of the custom attributes.

(just to clarify, these are custom attributes from additional models that all extend cm:content).

Thanks for any help!

-D
4 REPLIES 4

julio_melo
Champ in-the-making
Champ in-the-making
Hello dhartford,

I have found the default query template definition hard coded on tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.lib.js in line 22:


const QUERY_TEMPLATES = [
   {field: "keywords", template: "%(cm:name cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT)"}];

…and in line 799


      // perform fts-alfresco language query
      var queryDef = {
         query: ftsQuery,
         language: "fts-alfresco",
         page: {maxItems: params.maxResults},
         templates: QUERY_TEMPLATES,
         defaultField: "keywords",
         onerror: "no-results",
         sort: sortColumns
      };
      nodes = search.query(queryDef);

I changed there (line 22) to achieve the same that you wanted, but I would like to see a solution less intrusive.

Hi Julio,

  How can I do this customization in 5.0.c?

Thanks
Anil

dhartford
Champ on-the-rise
Champ on-the-rise
thanks julio,
I created a ticket based on you findings here: http://issues.alfresco.com/jira/browse/ALF-10145

vote for it and/or add additional comments as desired.

anujcb
Confirmed Champ
Confirmed Champ
I tried searching in for the js and couldnt find it