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

    Modifier and Type
    Method
    Description
    ServiceOutcome<org.apache.lucene.search.Query>
    buildLuceneQuery(com.atlassian.jira.jql.query.QueryCreationContext queryCreationContext, com.atlassian.query.Query baseQuery, io.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<Iterable<com.atlassian.jira.issue.Issue>>
    findOne(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
    Perform an issue search for a single issue.
    ServiceOutcome<Set<com.atlassian.query.Query>>
    findQueriesMatchingIssue(com.atlassian.jira.user.ApplicationUser user, Map<com.atlassian.jira.issue.Issue,Collection<com.atlassian.query.Query>> issuesAndQueries)
    Perform a search of the query to see if the specified issue matches it
    getJqlString(com.atlassian.query.Query query)
     
    boolean
    isQueryMatchingIssue(com.atlassian.jira.user.ApplicationUser 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<com.atlassian.jira.issue.search.SearchResults<com.atlassian.jira.issue.Issue>>
    search(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
    Perform an issue search using the specified user and query.
    ServiceOutcome<com.atlassian.jira.issue.search.SearchResults<com.atlassian.jira.issue.Issue>>
    search(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query, com.atlassian.jira.web.bean.PagerFilter<?> pager)
    Perform an issue search using the specified user, query, and pager.
    searchCount(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
    Perform an issue search using the specified user and query and return the number of results.
    searchCountOverrideSecurity(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
    Perform an issue search using the specified user and query and return the number of results.
    searchCountOverrideSecurity(com.atlassian.jira.user.ApplicationUser user, org.apache.lucene.search.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<com.atlassian.jira.issue.Issue>>
    searchOverrideSecurity(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
    Perform an issue search using the specified user and query and return the results.
  • Method Details

    • findOne

      @Nonnull ServiceOutcome<Iterable<com.atlassian.jira.issue.Issue>> findOne(com.atlassian.jira.user.ApplicationUser 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<com.atlassian.jira.issue.Issue>> search(com.atlassian.jira.user.ApplicationUser 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
    • search

      @Nonnull ServiceOutcome<com.atlassian.jira.issue.search.SearchResults<com.atlassian.jira.issue.Issue>> search(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query, com.atlassian.jira.web.bean.PagerFilter<?> pager)
      Perform an issue search using the specified user, query, and pager. Neatly wraps exceptions into ServiceOutcome.
      Parameters:
      user - the user
      query - the query
      pager - the pager
      Returns:
      the outcome
      Since:
      v9.0
    • searchCountOverrideSecurity

      @Nonnull ServiceOutcome<Long> searchCountOverrideSecurity(com.atlassian.jira.user.ApplicationUser 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<Long> searchCount(com.atlassian.jira.user.ApplicationUser 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<Long> searchCountOverrideSecurity(com.atlassian.jira.user.ApplicationUser 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<com.atlassian.jira.issue.Issue>> searchOverrideSecurity(com.atlassian.jira.user.ApplicationUser 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
    • findQueriesMatchingIssue

      @Nonnull ServiceOutcome<Set<com.atlassian.query.Query>> findQueriesMatchingIssue(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull Map<com.atlassian.jira.issue.Issue,Collection<com.atlassian.query.Query>> issuesAndQueries)
      Perform a search of the query to see if the specified issue matches it
      Parameters:
      user - the user to search as
      issuesAndQueries - the issue to match and the queries to check
      Returns:
      the outcome
    • isQueryMatchingIssue

      boolean isQueryMatchingIssue(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull com.atlassian.jira.issue.Issue issue, @Nonnull 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 check
      Returns:
      true if issue was found in the result or false if it was not present
    • buildLuceneQuery

      @Nonnull ServiceOutcome<org.apache.lucene.search.Query> buildLuceneQuery(com.atlassian.jira.jql.query.QueryCreationContext queryCreationContext, com.atlassian.query.Query baseQuery, io.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
    • getJqlString

      @Nonnull ServiceOutcome<String> getJqlString(com.atlassian.query.Query query)