com.atlassian.greenhopper.service.issue
Interface SearchService

All Known Implementing Classes:
SearchServiceImpl

public interface SearchService

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

Since:
v5.8.5
Author:
mtokar

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, org.apache.lucene.search.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<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.
 

Method Detail

findOne

@Nonnull
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. 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™


search

@Nonnull
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. Will automatically select the correct PagerFilter depending on GreenHopper's settings. Neatly wraps exceptions into ServiceOutcome.

Parameters:
user - the user
query - the query
Returns:
the outcome

searchCountOverrideSecurity

@Nonnull
ServiceOutcome<java.lang.Long> searchCountOverrideSecurity(com.atlassian.crowd.embedded.api.User user,
                                                                   org.apache.lucene.search.Query query)
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.

Parameters:
user - the user
query - the lucene query to search for
Returns:
the outcome

searchCount

@Nonnull
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. Neatly wraps exceptions into ServiceOutcome.

Parameters:
user - the user
query - the query
Returns:
the outcome

searchCountOverrideSecurity

@Nonnull
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. User's permissions are not taken into account when performing the search. Neatly wraps exceptions into ServiceOutcome.

Parameters:
user - the user
query - the query
Returns:
the outcome

searchOverrideSecurity

@Nonnull
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. User's permissions are not taken into account when performing the search. Neatly wraps exceptions into ServiceOutcome.

Parameters:
user - the user
query - the query
Returns:
the outcome

doesIssueMatchQuery

@Nonnull
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

Parameters:
user - the user to search as
issue - the issue to match
query - the query to use
Returns:
the outcome

buildLuceneQuery

@Nonnull
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.

Parameters:
queryCreationContext - the context
baseQuery - the base query
andQuery - the Lucene query to combine
Returns:
the outcome


Copyright © 2007-2014 Atlassian. All Rights Reserved.