cancel
Showing results for 
Search instead for 
Did you mean: 

Share custom advanced search AND/OR!!

ranj
Champ on-the-rise
Champ on-the-rise
Hi all,
I have created a custom advanced search with a content type, and its perfectly showing all the custom metadata details. But theres only one thing that I am in need…by default,the searh is performed for AND operation. How can I change it to OR operation?? Help needed!!!! Smiley Sad

Thanks in advance,
Ranjani.A
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
There is one configuration related to that you need to override in your alfresco-config-custom.xml
<search-and-terms>false</search-and-terms>

change it according to your requirement.

jpfi
Champ in-the-making
Champ in-the-making
Hi,
no sry, IMHO there is no such configuration file.
Share search is executed using a repo webscript in package org\alfresco\slingshot\search
The search query is generated in org\alfresco\slingshot\search\search.lib.js function getSearchResults(params)
-> You'll have to extend this search webscript.
Cheers, jan

Hi jan,

can you please write here the code for getSearchResults(params) method.

I have put this file in config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search and changed OR instead of AND.

I am not getting the exact result what i want.

My query looks like below:

((TYPE:"xyz:documentDetailType" AND (xyz:categoryTopic:"ABC" AND xyz:divisionCode:"ABC" AND xyz:typeOfDocument:"Reports")) AND -TYPE:"cm:thumbnail" AND -TYPE:"cm:failedThumbnail" AND -TYPE:"cm:rating") AND NOT ASPECT:"sys:hidden"

So, i want OR in between xyz:categoryTopic:"ABC" AND xyz:divisionCode:"ABC" AND xyz:typeOfDocument:"Reports" this part.