Package com.atlassian.jira.search.issue
Interface IssueDocumentSearchService
- All Known Implementing Classes:
DefaultIssueDocumentSearchService,TemporaryIssueDocumentSearchService
@PublicApi
public interface IssueDocumentSearchService
Allows running advanced searches against the Jira Issue index as opposed
to database (SQL) based queries.
Use
IssueDocumentSearchService if you need to
- optimize performance by loading only a limited number of fields with
fieldsToLoad - restrict results beyond
JQL queryby settingadditional search query - compute aggregated results using
aggregation request - [advanced use] collect all results using
searchStream(DocumentSearchRequest)
Replaces
invalid reference
com.atlassian.jira.issue.search.SearchProvider
- Since:
- 10.4
-
Method Summary
Modifier and TypeMethodDescriptionlonggetHitCount(ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity) Return the number of documents that match thejqlQuerylonggetHitCount(ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity, Long timeout) Return the number of documents that match thejqlQuerysearch(DocumentSearchRequest request, PageRequest pageRequest) Run a search against the Issue index, loading only a restricted subset of fields for each document.default SearchResponsesearch(DocumentSearchRequest request, PagerFilter pager) Run a search against the Issue index, loading only a restricted subset of fields for each document.searchStream(DocumentSearchRequest request) Run a search against the Issue index, loading only a restricted subset of fields for each document.
-
Method Details
-
search
SearchResponse search(DocumentSearchRequest request, PageRequest pageRequest) throws SearchException Run a search against the Issue index, loading only a restricted subset of fields for each document.Results ordering
Results are sorted according toQuery.getOrderByClause()and query scoring.Aggregation
To compute aggregated results, defineDocumentSearchRequest.aggregations(). The aggregation will be computed for all documents matching thequery. To return only aggregated results, instantiatepagerwithnew PagerFilter(0)- Parameters:
request- Set of parameters to define which index documents should be returned.pageRequest- PageRequest to restrict the portion of documents matching thequerythat will be returned.- Returns:
SearchResponsecontaining index documents with only specific fields loaded- Throws:
SearchException- exception thrown when the search fails
-
search
default SearchResponse search(DocumentSearchRequest request, PagerFilter pager) throws SearchException Run a search against the Issue index, loading only a restricted subset of fields for each document.Results ordering
Results are sorted according toQuery.getOrderByClause()and query scoring.Aggregation
To compute aggregated results, defineDocumentSearchRequest.aggregations(). The aggregation will be computed for all documents matching thequery. To return only aggregated results, instantiatepagerwithnew PagerFilter(0)- Parameters:
request- Set of parameters to define which index documents should be returned.pager- PagerFilter to restrict the portion of documents matching thequerythat will be returned.- Returns:
SearchResponsecontaining index documents with only specific fields loaded- Throws:
SearchException- exception thrown when the search fails
-
searchStream
Run a search against the Issue index, loading only a restricted subset of fields for each document. The search hits are returned as a stream, which is memory efficient for handling a large number of hits.Results ordering
Sorting is not supported when streaming results. If sorting is required, usesearch(DocumentSearchRequest, PageRequest)instead, sorting with pagination.Aggregation
To compute aggregated results, defineDocumentSearchRequest.aggregations(). The aggregation will be computed for all documents matching thequery. To return only aggregated results, instantiatepagerwithnew PagerFilter(0)- Parameters:
request- Set of parameters to define which index documents should be returned.- Returns:
SearchStreamResponsecontaining stream of index documents with only specific fields loaded- Throws:
SearchException- exception thrown when the search fails- Since:
- 10.6
-
getHitCount
long getHitCount(ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity) throws SearchException Return the number of documents that match thejqlQuery- Parameters:
jqlQuery- Query to define which index documents should be counted.- Returns:
- the number of documents that match the
jqlQuery - Throws:
SearchException
-
getHitCount
long getHitCount(ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity, @Nullable Long timeout) throws SearchException Return the number of documents that match thejqlQuery- Parameters:
jqlQuery- Query to define which index documents should be counted.timeout- Query timeout in milliseconds- Returns:
- the number of documents that match the
jqlQuery - Throws:
SearchException- exception thrown when the search fails
-