Package com.atlassian.jira.search.issue
Class DefaultIssueDocumentSearchService
java.lang.Object
com.atlassian.jira.search.issue.DefaultIssueDocumentSearchService
- All Implemented Interfaces:
IssueDocumentSearchService
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
public class DefaultIssueDocumentSearchService
extends Object
implements IssueDocumentSearchService
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIssueDocumentSearchService
(IndexAccessorRegistry issueIndexAccessorRegistry, DefaultQueryFactory defaultQueryFactory, QuerySortExtractor querySortExtractor) -
Method Summary
Modifier and TypeMethodDescriptionlong
getHitCount
(ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity) Return the number of documents that match thejqlQuery
long
getHitCount
(ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity, Long timeout) Return the number of documents that match thejqlQuery
search
(DocumentSearchRequest request, PageRequest pageRequest) 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.search.issue.IssueDocumentSearchService
search
-
Constructor Details
-
DefaultIssueDocumentSearchService
public DefaultIssueDocumentSearchService(IndexAccessorRegistry issueIndexAccessorRegistry, DefaultQueryFactory defaultQueryFactory, QuerySortExtractor querySortExtractor)
-
-
Method Details
-
search
public SearchResponse search(DocumentSearchRequest request, PageRequest pageRequest) throws SearchException Description copied from interface:IssueDocumentSearchService
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, instantiatepager
withnew PagerFilter(0)
- Specified by:
search
in interfaceIssueDocumentSearchService
- Parameters:
request
- Set of parameters to define which index documents should be returned.pageRequest
- PageRequest to restrict the portion of documents matching thequery
that will be returned.- Returns:
SearchResponse
containing index documents with only specific fields loaded- Throws:
SearchException
- exception thrown when the search fails
-
searchStream
Description copied from interface:IssueDocumentSearchService
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, useIssueDocumentSearchService.search(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, instantiatepager
withnew PagerFilter(0)
- Specified by:
searchStream
in interfaceIssueDocumentSearchService
- Parameters:
request
- Set of parameters to define which index documents should be returned.- Returns:
SearchStreamResponse
containing stream of index documents with only specific fields loaded- Throws:
SearchException
- exception thrown when the search fails
-
getHitCount
public long getHitCount(@Nullable ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity) throws SearchException Description copied from interface:IssueDocumentSearchService
Return the number of documents that match thejqlQuery
- Specified by:
getHitCount
in interfaceIssueDocumentSearchService
jqlQuery
- Query to define which index documents should be counted.- Returns:
- the number of documents that match the
jqlQuery
- Throws:
SearchException
-
getHitCount
public long getHitCount(@Nullable ApplicationUser searcher, Query jqlQuery, boolean overrideSecurity, @Nullable Long timeout) throws SearchException Description copied from interface:IssueDocumentSearchService
Return the number of documents that match thejqlQuery
- Specified by:
getHitCount
in interfaceIssueDocumentSearchService
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
-