com.atlassian.greenhopper.service.issue
Class SearchServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.issue.SearchServiceImpl
All Implemented Interfaces:
SearchService

@Service
public class SearchServiceImpl
extends java.lang.Object
implements SearchService

Wrapper around JIRA's SearchService to make results easier to consume in GH.

Since:
v5.8.5
Author:
mtokar

Constructor Summary
SearchServiceImpl()
           
 
Method Summary
 ServiceOutcome<org.apache.lucene.search.Query> buildLuceneQuery(com.atlassian.jira.jql.query.QueryCreationContext queryCreationContext, com.atlassian.query.Query baseQuery, com.atlassian.fugue.Option<org.apache.lucene.search.Query> andQuery)
          Combine a base query (typically from a saved filter/JQL) with a Lucene query to form one Lucene query that returns the intersection of both queries.
 ServiceOutcome<java.lang.Boolean> doesIssueMatchQuery(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.issue.Issue issue, com.atlassian.query.Query query)
          Perform a search of the query to see if the specified issue matches it
 ServiceOutcome<java.lang.Iterable<com.atlassian.jira.issue.Issue>> findOne(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Perform an issue search for a single issue.
 ServiceOutcome<com.atlassian.jira.issue.search.SearchResults> search(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Perform an issue search using the specified user and query.
 ServiceOutcome<java.lang.Long> searchCount(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Perform an issue search using the specified user and query and return the number of results.
 ServiceOutcome<java.lang.Long> searchCountOverrideSecurity(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Perform an issue search using the specified user and query and return the number of results.
 ServiceOutcome<java.lang.Long> searchCountOverrideSecurity(com.atlassian.crowd.embedded.api.User user, org.apache.lucene.search.Query query)
          Fetches a search result count overriding security for a lucene query.
 ServiceOutcome<com.atlassian.jira.issue.search.SearchResults> searchOverrideSecurity(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Perform an issue search using the specified user and query and return the results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchServiceImpl

public SearchServiceImpl()
Method Detail

findOne

@Nonnull
public ServiceOutcome<java.lang.Iterable<com.atlassian.jira.issue.Issue>> findOne(com.atlassian.crowd.embedded.api.User user,
                                                                                          com.atlassian.query.Query query)
Description copied from interface: SearchService
Perform an issue search for a single issue. Will configure the PagerFilter appropriately. Returns an Iterable so you can neatly just for-each it if there are no errors, and things just work™

Specified by:
findOne in interface SearchService

search

@Nonnull
public ServiceOutcome<com.atlassian.jira.issue.search.SearchResults> search(com.atlassian.crowd.embedded.api.User user,
                                                                                    com.atlassian.query.Query query)
Description copied from interface: SearchService
Perform an issue search using the specified user and query. Will automatically select the correct PagerFilter depending on GreenHopper's settings. Neatly wraps exceptions into ServiceOutcome.

Specified by:
search in interface SearchService
Parameters:
user - the user
query - the query
Returns:
the outcome

searchOverrideSecurity

@Nonnull
public ServiceOutcome<com.atlassian.jira.issue.search.SearchResults> searchOverrideSecurity(com.atlassian.crowd.embedded.api.User user,
                                                                                                    com.atlassian.query.Query query)
Description copied from interface: SearchService
Perform an issue search using the specified user and query and return the results. User's permissions are not taken into account when performing the search. Neatly wraps exceptions into ServiceOutcome.

Specified by:
searchOverrideSecurity in interface SearchService
Parameters:
user - the user
query - the query
Returns:
the outcome

doesIssueMatchQuery

@Nonnull
public ServiceOutcome<java.lang.Boolean> doesIssueMatchQuery(com.atlassian.crowd.embedded.api.User user,
                                                                     com.atlassian.jira.issue.Issue issue,
                                                                     com.atlassian.query.Query query)
Description copied from interface: SearchService
Perform a search of the query to see if the specified issue matches it

Specified by:
doesIssueMatchQuery in interface SearchService
Parameters:
user - the user to search as
issue - the issue to match
query - the query to use
Returns:
the outcome

buildLuceneQuery

@Nonnull
public ServiceOutcome<org.apache.lucene.search.Query> buildLuceneQuery(com.atlassian.jira.jql.query.QueryCreationContext queryCreationContext,
                                                                               com.atlassian.query.Query baseQuery,
                                                                               com.atlassian.fugue.Option<org.apache.lucene.search.Query> andQuery)
Description copied from interface: SearchService
Combine a base query (typically from a saved filter/JQL) with a Lucene query to form one Lucene query that returns the intersection of both queries.

Specified by:
buildLuceneQuery in interface SearchService
Parameters:
queryCreationContext - the context
baseQuery - the base query
andQuery - the Lucene query to combine
Returns:
the outcome

searchCount

@Nonnull
public ServiceOutcome<java.lang.Long> searchCount(com.atlassian.crowd.embedded.api.User user,
                                                          com.atlassian.query.Query query)
Description copied from interface: SearchService
Perform an issue search using the specified user and query and return the number of results. Neatly wraps exceptions into ServiceOutcome.

Specified by:
searchCount in interface SearchService
Parameters:
user - the user
query - the query
Returns:
the outcome

searchCountOverrideSecurity

@Nonnull
public ServiceOutcome<java.lang.Long> searchCountOverrideSecurity(com.atlassian.crowd.embedded.api.User user,
                                                                          com.atlassian.query.Query query)
Description copied from interface: SearchService
Perform an issue search using the specified user and query and return the number of results. User's permissions are not taken into account when performing the search. Neatly wraps exceptions into ServiceOutcome.

Specified by:
searchCountOverrideSecurity in interface SearchService
Parameters:
user - the user
query - the query
Returns:
the outcome

searchCountOverrideSecurity

@Nonnull
public ServiceOutcome<java.lang.Long> searchCountOverrideSecurity(com.atlassian.crowd.embedded.api.User user,
                                                                          org.apache.lucene.search.Query query)
Fetches a search result count overriding security for a lucene query. As this isn't available through SearchProvider, so we have to go to the issue searcher directly

Specified by:
searchCountOverrideSecurity in interface SearchService
Parameters:
user - the user
query - the lucene query to search for
Returns:
the outcome


Copyright © 2007-2014 Atlassian. All Rights Reserved.