com.atlassian.jira.jql.query
Class AllTextClauseQueryFactory

java.lang.Object
  extended by com.atlassian.jira.jql.query.AllTextClauseQueryFactory
All Implemented Interfaces:
ClauseQueryFactory

public class AllTextClauseQueryFactory
extends java.lang.Object
implements ClauseQueryFactory

Builds lucene queries for the "all text" clause. This clause aggregates all the free text fields in the system which the user can see (or simply all fields if we are overriding security). Therefore, we acquire the appropriate clause query factories for these fields, collect their individual results, then aggregate them with SHOULDs.

For example, the query text ~ "john" is equivalent to summary ~ "john" OR description ~ "john" OR ....

Since:
v4.0
See Also:
AllTextSearchConstants

Constructor Summary
AllTextClauseQueryFactory(CustomFieldManager customFieldManager, SearchHandlerManager searchHandlerManager)
           
 
Method Summary
 QueryFactoryResult getQuery(QueryCreationContext queryCreationContext, TerminalClause terminalClause)
          Generates a lucene query for the passed TerminalClause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllTextClauseQueryFactory

public AllTextClauseQueryFactory(CustomFieldManager customFieldManager,
                                 SearchHandlerManager searchHandlerManager)
Method Detail

getQuery

public QueryFactoryResult getQuery(QueryCreationContext queryCreationContext,
                                   TerminalClause terminalClause)
Description copied from interface: ClauseQueryFactory
Generates a lucene query for the passed TerminalClause. It is the responsibility of the factory to look at the Operator and Operand in the Termincal and generate a Lucene search for it. This method is only called after JIRA works out that the TermincalClause is relevant to this ClauseQueryFactory. A ClauseFactory needs to be careful when implementing the NOT_LIKE, NOT_EQUALS or NOT_IN operators. These negative operators should not match what is considered EMPTY. For example, the query "resolution is EMPTY" will return all unresolved issues in JIRA. The query "resolution != fixed" will only return all resolved issues that have not been resolved as "fixed", that is, it will not return any unresolved issues. The user would have to enter the query "resolution != fixed or resolution is EMPTY" to find all issues that are either unresolved or not resolved as "fixed". The ClauseQueryFactory must handle the situation when an invalid TerminalClause is passed. The ClauseQueryFactory must return an empty Lucene Search if the passed TerminalClause is invalid. Most importantly, ClauseQueryFactory may not throw an exception on the input of an invalid TermincalClause.

Specified by:
getQuery in interface ClauseQueryFactory
Parameters:
queryCreationContext - the context of the query creation call; used to indicate that permissions should be ignored for "admin queries"
terminalClause - the clause for which this factory is generating a query.
Returns:
QueryFactoryResult contains the query that lucene can use to search and metadata about the query. Null cannot be returned.


Copyright © 2002-2010 Atlassian. All Rights Reserved.