com.atlassian.jira.issue.search.parameters.lucene.util
Class QueryForCommentsCreator

java.lang.Object
  extended by com.atlassian.jira.issue.search.parameters.lucene.util.QueryForCommentsCreator

public final class QueryForCommentsCreator
extends Object


Method Summary
static org.apache.lucene.search.Query createGroupLevelQuery(List groups)
          Creates a new query with OR-ed groups
static org.apache.lucene.search.Query createNoGroupOrProjectRoleLevelQuery()
          Creates new query with the restriction of comment group level set to -1 (no group level) AND comment project role level set to -1 (no project role level).
static org.apache.lucene.search.Query createProjectRoleLevelQuery(ProjectRoleManager.ProjectIdToProjectRoleIdsMap projectIdToProjectRolesMap)
          Creates a project role level based restriction query.
static org.apache.lucene.search.Query createTextQuery(List fieldsList, String searchText, Map boostMap)
          This method creates a boosted query (if boostMap is specified).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createNoGroupOrProjectRoleLevelQuery

public static org.apache.lucene.search.Query createNoGroupOrProjectRoleLevelQuery()
Creates new query with the restriction of comment group level set to -1 (no group level) AND comment project role level set to -1 (no project role level).

Returns:
query

createGroupLevelQuery

public static org.apache.lucene.search.Query createGroupLevelQuery(List groups)
                                                            throws IllegalArgumentException
Creates a new query with OR-ed groups

Parameters:
groups - a list of groups to include in the query (List[String])
Returns:
Query with OR-ed groups
Throws:
IllegalArgumentException - if groups is null or empty

createProjectRoleLevelQuery

public static org.apache.lucene.search.Query createProjectRoleLevelQuery(ProjectRoleManager.ProjectIdToProjectRoleIdsMap projectIdToProjectRolesMap)
Creates a project role level based restriction query.

NOTE: This method should not be called with null or empty map (i.e if the user is not a member of any roles). If the user is not a member of any roles, the right thing to do is not to call this method.

Parameters:
projectIdToProjectRolesMap - Map[Long,Collection[ProjectRole]]
Returns:
query
Throws:
IllegalArgumentException - if projectIdToProjectRolesMap is null or empty

createTextQuery

public static org.apache.lucene.search.Query createTextQuery(List fieldsList,
                                                             String searchText,
                                                             Map boostMap)
                                                      throws IllegalArgumentException,
                                                             org.apache.lucene.queryParser.ParseException
This method creates a boosted query (if boostMap is specified). The query consists of OR-ed fields with value equal to the given search text.

Parameters:
fieldsList - field list
searchText - search text
boostMap - boost map
Returns:
boosted query
Throws:
IllegalArgumentException - if field list is null
org.apache.lucene.queryParser.ParseException - if parsing erro occurs


Copyright © 2002-2009 Atlassian. All Rights Reserved.