In JIRA 4, all we needed to do was to change com.atlassian.jira.jql.query.LikeQueryFactory a little.
In JIRA 4, JQL uses the LIKE search on all text fields and only on text fields which allows us to easily limit the AND operation to selected fields. We added the following lines of code to the getQueries method which parses the query input and sets the operand:
if(fieldName.equalsIgnoreCase("summary") || fieldName.equalsIgnoreCase("description") ||
fieldName.equalsIgnoreCase("body") || fieldName.equalsIgnoreCase("environment") )
{
parser.setDefaultOperator(QueryParser.AND_OPERATOR);
}
So we limited the AND operand as the default to only the following fields:
1. Summary
2. Description
3. Environment
4. Comments
Any other text fields will still be using the default operand, which is OR, and the combination between different search conditions is always AND unless you use the advanced search to change that.
We now have much more precise and useful search results. We no longer have people overloading the server with their imprecise searches. And if someone happens to enter a very generic search term, he no longer gets the message that the number of search results exceeded the configured limit, but the other not-so-generic search terms limit his search results as they well should.
We have also provided the details to Atlassian in our support ticket with them, in the hope that they will implement the change or even better make this an admin-configurable option.
Thank for the good news!!
Could you please let us know which files we need change in Jira 5.1 to work out this issue.