[ALF-6349] Patch for changeable default operator of the Share full text search Created: 25-Dec-10  Updated: 29-Jul-16  Resolved: 29-Jul-16

Status: Closed
Project: Alfresco
Component/s: Repository
Affects Version/s: 3.4 Enterprise
Fix Version/s: None
Security Level: external (External user)

Type: Contribution Priority: Critical
Reporter: Hiroyuki Wada (Inactive) Assignee: Closed Issues
Resolution: Won't Fix Votes: 16
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Alfresco 3.4.x / 4.0.x

Attachments: File andOperator.diff     File changeableDefaultOperator.diff    
Issue Links:
relates to MNT-2797 Share forms selectmany.ftl template d... Closed
Date of First Response:


The Share full text search is like google, but the default operator is "OR". According to google basic search principles, the default operator is "AND".
It would be nice if the search in Alfresco works the same.

I created a patch for supporting chageable default operator.
By applying this patch, you can change default operator in "alfresco/WEB-INF/classes/alfresco/script-service-context.xml" as follows.

<bean id="searchScript" parent="baseJavaScriptExtension" class="org.alfresco.repo.jscript.Search">
<property name="extensionName">
<property name="serviceRegistry">
<ref bean="ServiceRegistry"/>
<property name="repositoryHelper">
<ref bean="repositoryHelper"/>
<property name="storeUrl">
<property name="defaultOperator">

Thank you,

Comment by Koen Bonnet (Inactive) [ 15-May-12 ]

This is really something that needs to change in the standard application. I can't see any rationale in choosing OR as the default operator AND not making it configurable. IMHO

Comment by Patrick Vanhoof (Inactive) [ 22-Jun-12 ]

Is the diff still valid for 3.4.9?

Comment by Alex Madon [X] (Inactive) [ 24-Jul-12 ]

This could probably be put in place as a parameter for textfield.ftl


as we have done in ALF-13475 for the Share forms selectmany.ftl template

Comment by Koen Bonnet (Inactive) [ 24-Jul-12 ]

@Alex, that wouldnt solve the issue for the simple search field, would it? This is the field end user tend to use as much as possible.


Comment by Peter Löfgren [ 24-Aug-12 ]

Attaching a slightly different patch for how to solve this. This doesn't change the default search behaviou, instead introduces a parameter that can be used to switch between AND OR.
I written about it here http://loftux.com/2012/08/24/fix-alfresco-share-quick-search/

The change can be taken one step further so to add if AND or OR should be use as a config parameter in search.get.config.xml.

Comment by Peter Löfgren [ 24-Aug-12 ]

Should have added that the patch is against 4.0.d source.

Comment by Jennie Soria [X] (Inactive) [ 24-May-14 ]

Customer cases have been added to MNT-10800. Not sure if this needs to be kept open, or closed as duplicate of MNT-10800. I would suggest closing as duplicate.

Comment by Heiko Robert (Inactive) [ 26-May-14 ]

@loftux: unfortunately this patch doesn't work for 4.2.f and needs some more research / more fixes.
btw. it would be better to implement a configurable parameter and fantastic if Alfresco implements this as a missing important feature. To maintain patches like this over versions is no fun and very expensive.
@Jennie Soria: feel free to add a new enhancement request if you'd like to close this ticket (MNT-10800 is not public).

Comment by Peter Löfgren [ 26-May-14 ]

@Heiko A similar solution is implemented and available in Community HEAD. If you still need it for 4.2.f, it should work withs some changes as I have been using it with 4.2.e/f versions.

Comment by Richard Esplin [X] (Inactive) [ 29-Jul-16 ]

This issue was reported against a version of Alfresco Enterprise Edition that is in Limited Support. Alfresco Software will not implement further enhancements or improvements for products or versions in this support state. If this issue is impacting your deployment of Alfresco One Enterprise Edition, please contact support so that we can assist you. Customers with a support contract can request a bug fix in certain cases.

Current releases of Alfresco contain many improvements that address old problems. We are closing old issues so that we can better prioritize our efforts.

If you verify that the issue still exists in the latest release of Alfresco Community Edition, please reopen the issue. If you have any trouble reopening the issue, then leave a comment or email us at community@alfresco.com so that we can assist.

Thank you for collaborating with us on improving Alfresco.

Generated at Wed Aug 12 23:06:42 BST 2020 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.