cancel
Showing results for 
Search instead for 
Did you mean: 

search custom properties?

aweber1nj
Champ in-the-making
Champ in-the-making
Newbie question:  I think I saw this referenced somewhere, but I can't locate it now…

Is there a "trick" or additional step that has to be performed after installing a custom content model such that properties designated as "Indexed" will actually be indexed and searchable through the default share "keywords" and "simple searchbox"?

It seems like none of my custom properties are searchable even if I designated them to be indexed in the content model.

Do I have to reset the FT Index somehow so it rebuilds its schema or something like that?

If there's a link that explains it, I will be happy to "RTFM".  Sorry I couldn't locate it myself, so I'm asking here. Smiley Happy

-AJ
1 ACCEPTED ANSWER

jpotts
World-Class Innovator
World-Class Innovator
It turns out this has gotten easier in Alfresco 4. The "search template" has been moved to a config file, so you do not have to override the entire search.lib.js file, which is a Good Thing.

So, if you are using Alfresco 4, here are the steps:

1. Copy $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.config.xml to  $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/search.get.config.xml

2. Edit $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/search.get.config.xml

3. Add your custom properties to the default-query-template element. For example, suppose I want to add scSmiley Tongueroduct and sc:version to the list of properties that are searched by default. My default-query-template element would look like this:
<search>
   <default-query-template>%(cm:name cm:title cm:description sc:product sc:version ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT TAG)</default-query-template>
</search>

4. Save the file, restart Tomcat, & search!

If you are using a release older than Alfresco 4, the concept is the same, but instead of overriding search.get.config.xml you will override search.lib.js and change the QUERY_TEMPLATES constant.

Jeff

View answer in original post

25 REPLIES 25

douglascrp
World-Class Innovator
World-Class Innovator
You have to use the extension points Alfresco offers.

In the case, one option is to use the shared folder, which usually is configured as:
for Alfresco
<alfresco_install_path>/tomcat/shared/classes/alfresco/extension


for Share
<alfresco_install_path>/tomcat/shared/classes/alfresco/web-extension

unkndev
Champ on-the-rise
Champ on-the-rise
With the Alfresco 5.1 search webscripts were moved to the 'alfresco-share-services' project (alfresco-share-services-5.1.e.jar).
You can find source code here: https://svn.alfresco.com/repos/alfresco-open-mirror/web-apps/Share/trunk/share-services/src/main/res...

To override default configuration put your configuration files (e.g. live-search-docs.get.config.xml, search.get.config.xml) into directory: %TOMCAT_HOME%/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/

Best regards from Lublin@Poland Smiley Happy

I am trying to implement this... I tried the change, put the files in the folder, restarted alfresco, but still when I search I do not get things that match my custom fields.  Is there a log file to check to see if there are errors? or any way to debug?

You should share your code in order to help us to help you.

sandeepreddy1
Star Contributor
Star Contributor
Hai Everyone,

I need to search @my\:categoryTypeModel:"General" and @my\:categoryTypeModel:"Restricted" types with General and Restricted. For this search configuration where i need to change code can anyone help me please.
i attached my files. can anyone please check once
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.