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

jpotts
World-Class Innovator
World-Class Innovator
There's no trick. They'll be added to the index automatically. You should be able to search for them in the Share Search box by typing the namespace followed by the property name followed by the property value. For example, given a property named "scSmiley Tongueroduct", I can search for values of that property like this:

scSmiley Tongueroduct:'Foo'

If you want users to be able to simply type "Foo" and have Share include "scSmiley Tongueroduct" in the list of properties it searches against by default, that's different and that does require a little bit of work, but it isn't bad. Basically, you override the search web script on the repository tier.

Hope that gets you pointed in the right direction.

Jeff

aweber1nj
Champ in-the-making
Champ in-the-making
OK, the latter "feature" is exactly what I'd like my users to be able to do.

Do you know of any Wiki articles or similar information for me to review to tweak the search web script?

(I leveraged many points of your "content article", thank you for that.  Maybe this kind of info should be added to v3? Smiley Wink )

Thanks again,
AJ

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

applelam
Champ in-the-making
Champ in-the-making
I can't find "<default-query-template>%(cm:name cm:title cm:description scSmiley Tongueroduct sc:version ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT TAG)</default-query-template>" in Alfresco5.0.a. Please help me!

kaynezhang
World-Class Innovator
World-Class Innovator
Open file
 $TOMCAT_HOME/webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.a-SNAPSHOT.jar
,and browse to
alfresco/templates/webscripts/org/alfresco/slingshot/search
,it is now packaged in this jar file.

Thank you, let me try this out!

jakeer
Champ on-the-rise
Champ on-the-rise
Thank in advance for the information which you have provide.

I am using alfresco community version 5.1.0 (r122274-b3). in this version I am unable find 'search.get.config.xml' file. In version 5.0 as you said it is there in $TOMCAT_HOME/webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.a-SNAPSHOT.jar file. Do you have any idea about version 5.1.0 (r122274-b3)

gelek
Champ in-the-making
Champ in-the-making
I'm also using ver 5.1.0 (r122274-b3) and I can't find 'search.get.config.xml' file 😞

Please help me, where is this file "search web script" ?

Where I can add my custom "id properties" or "id aspects" to make simple searching in search box ?

Today I must enter value "model1:numer:'777'" to search value "777" 😞

Please help me.

nwali
Star Contributor
Star Contributor

How to override the files at below location?

alfresco/templates/webscripts/org/alfresco/slingshot/search

Modify them at that location or copy them to different location?

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.