cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Search with custom metadata in Share or the 'search.lib.js' issue

angelborroy
Community Manager Community Manager
Community Manager
Recently we had a problem with advanced search in Alfresco 4.2.e: it was returning incorrect results. We are using Spanish as language.

After some debugging we have modified this line on "alfresco-4.2.e/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.lib.js"

<strong>Original code</strong>
943: formQuery += (first ? '' : ' AND ') + escapeQName(propName) + ':\\"' + propValue + '\\"';


<strong>Modified code</strong>
943: formQuery += (first ? '' : ' AND ') + escapeQName(propName) + ':\"' + propValue + '\"';


Original Alfresco code includes \\" before and after propValue, which make FTS queries to fail. It has been replaced by \"

I wonder if this is an issue or if this is a correct behavior (maybe in other base language like English).


Hyland Developer Evangelist
6 REPLIES 6

angelborroy
Community Manager Community Manager
Community Manager
Finally I've decided to create an issue (https://issues.alfresco.com/jira/browse/ALF-20988). It seems a real bug.
Hyland Developer Evangelist

douglascrp
World-Class Innovator
World-Class Innovator
Yes, it's a real bug.

I also "fixed" that on my server.

eswbitto
Confirmed Champ
Confirmed Champ
Do you know if your known issue is for english as well or just spanish?

douglascrp
World-Class Innovator
World-Class Innovator
We faced the same problem for Portuguese.

angelborroy
Community Manager Community Manager
Community Manager
I don't know. Issue is at the investigation queue…
Hyland Developer Evangelist

uvukasinovic
Champ on-the-rise
Champ on-the-rise
Just want to let you know that I had the same issue with the Advanced Search(Alfresco 4.2.f).
With custom property 'my:number' of type d:int, Advanced Search returned 0 results.

Code from Angel Borroy helped me to offer a search of custom properties without quotation marks.

Testing:
For example, if there is a content where 'my:number' is 22, and I put that number in appropriate form box:

Without solution from above:

1. 22 : 0 results : not correct
2. "22" : 1 result : correct

With solution from above:

1. 22: 1 result: correct
2. "22": 1 result: correct

Thanks, Angel Borroy.