com.atlassian.jira.bc.issue.search.SearchService |
Known Indirect Subclasses |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
Provides functionality (search, query string generation, parsing, validation, context generation, etc...) related to
searching in JIRA. This deals with Query
's which contain the search criteria in JIRA.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SearchService.ParseResult |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks if a
Query is capable of being shown on the simple (GUI-based) issue navigator edit screen. | |||||||||||
Generates a JQL string representation for the passed query.
| |||||||||||
Gets the JQL string representation for the passed query.
| |||||||||||
Generates a full QueryContext for the specified
Query for the searching user. | |||||||||||
Returns the query string to represent the specified SearchQuery.
| |||||||||||
This produces an old-style
SearchContext based on the passed in
search query and the user that is performing the search. | |||||||||||
Generates a simple QueryContext for the specified
Query for the searching user. | |||||||||||
Parses the query string into a JQL
Query . | |||||||||||
Returns an equivalent
Query with all the potential "information leaks" removed,
with regards to the specified user. | |||||||||||
Search the index, and only return issues that are in the pager's range.
| |||||||||||
Search the index, and return the count of the issues matching the query.
| |||||||||||
Validates the specified
Query for passed user. | |||||||||||
Validates the specified
Query for passed user and search request. |
Checks if a Query
is capable of being shown on the simple (GUI-based) issue navigator edit screen.
user | the user who is executing the query. |
---|---|
query | the Query which to check that is displayable on the simple (GUI-based) issue navigator edit screen. Does not accept null. |
Generates a JQL string representation for the passed query. The JQL string is always generated, that is, getQueryString()
is completely ignored if it exists. The returned JQL is automatically escaped as necessary.
query | the query. Cannot be null. |
---|
Gets the JQL string representation for the passed query. Returns the string from getQueryString()
if it exists or generates one if it does not. Equilavent to:
if (query.getQueryString() != null) return query.getQueryString(); else return getGeneratedJqlString(query);
query | the query. Cannot be null. |
---|
Generates a full QueryContext for the specified Query
for the searching user. The full
QueryContext contains all explicit and implicitly specified projects and issue types from the Query.
QueryContextVisitor
.searcher | the user performing the search |
---|---|
query | the search query to generate the context for |
Returns the query string to represent the specified SearchQuery.
The query string is prepended with "&jqlQuery=
" so that it is ready for use in building a URL.
user | the user performing the search |
---|---|
query | the SearchQuery to generate the query string of. Does not accept null. |
This produces an old-style SearchContext
based on the passed in
search query and the user that is performing the search.
This will only make sense if the query returns true for doesQueryFitFilterForm(com.atlassian.crowd.embedded.api.User, com.atlassian.query.Query)
since SearchContext is only relevant for simple queries.
The more acurate context can be gotten by calling getQueryContext(com.atlassian.crowd.embedded.api.User, com.atlassian.query.Query)
.
If the query will not fit in the simple issue navigator then the generated SearchContext will be empty. This
method never returns a null SearchContext, even when passed a null SearchQuery.
searcher | the user performing the search, not always the SearchRequest's owner |
---|---|
query | the query for which you want a context |
Generates a simple QueryContext for the specified Query
for the searching user.
The simple QueryContext contains only the explicit projects and issue types specified in the Query. If none were
specified, it will be the Global context.
QueryContextVisitor
.searcher | the user performing the search |
---|---|
query | the search query to generate the context for |
Returns an equivalent Query
with all the potential "information leaks" removed,
with regards to the specified user. For example, if the query contains the clause "project = Invisible", and the
specified user does not have browse permission for project "Invisible", the sanitised query will replace this
clause with "project = 12345" (where 12345 is the id of the project).
searcher | the user performing the search |
---|---|
query | the query to sanitise; must not be null. |
Search the index, and only return issues that are in the pager's range.
Note: that this method returns read only Issue
objects, and should not be
used where you need the issue for update.
Also note that if you are after running a more complicated query see SearchProvider
.
searcher | the user performing the search, which will be used to create a permission filter that filters out any of the results the user is not able to see and will be used to provide context for the search. |
---|---|
query | contains the information required to perform the search. |
pager | Pager filter (use getUnlimitedFilter() to get all issues). |
SearchResults
containing the resulting issues.SearchException | thrown if there is a severe problem encountered with lucene when searching (wraps an IOException). |
---|
Search the index, and return the count of the issues matching the query.
searcher | the user performing the search, which will be used to create a permission filter that filters out any of the results the user is not able to see and will be used to provide context for the search. |
---|---|
query | contains the information required to perform the search. |
SearchException | thrown if there is a severe problem encountered with lucene when searching (wraps an IOException). |
---|
Validates the specified Query
for passed user. The same as calling
validateQuery(searcher, query, null);
.
searcher | the user performing the search |
---|---|
query | the search query to validate |
Validates the specified Query
for passed user and search request. This validates the
the passed query as if it was run as the passed search request.
searcher | the user performing the search. |
---|---|
query | the search query to validate. |
searchRequestId | validate in the context of this search request. Can be null to indicate the passed query is not currently a search request. |