public class

DualSearchProvider

extends Object
implements SearchProvider
java.lang.Object
   ↳ com.atlassian.jira.issue.search.providers.DualSearchProvider

Class Overview

Delegates to the LuceneSearchProvider and provides timing information. Also sends the same query to the DbSearchProvider in a separate thread, if we have enabled database comparisons.

Summary

Nested Classes
interface DualSearchProvider.SearchConsumer<E extends Exception>  
interface DualSearchProvider.SearchSupplier<T, E extends Exception>  
Public Constructors
DualSearchProvider(LuceneSearchProvider luceneSearchProvider, DbSearchProvider dbSearchProvider, SearchHandlerManager searchHandlerManager, FeatureManager featureManager, InstrumentationListenerManager instrumentationListenerManager, InstrumentationLogger instrumentationLogger, CustomFieldManager customFieldManager)
Public Methods
void search(Query query, ApplicationUser searcher, Collector collector, Query andQuery)
Run a search based on the provided search criteria and, for each match, call Collector.collect().
void search(Query query, ApplicationUser searcher, Collector collector)
Run a search based on the provided search criteria and, for each match, call Collector.collect().
SearchResults search(Query query, ApplicationUser searcher, PagerFilter pager)
Search the index, and only return issues that are in the pager's range.
SearchResults search(Query query, ApplicationUser searcher, PagerFilter pager, Query andQuery)
Search the index, and only return issues that are in the pager's range while AND'ing the raw lucene query to the generated query from the provided searchQuery.
void searchAndSort(Query query, ApplicationUser searcher, Collector collector, PagerFilter pager)
Run a search based on the provided search criteria and, for each match call Collector.collect().
void searchAndSortOverrideSecurity(Query query, ApplicationUser searcher, Collector collector, PagerFilter pager)
Run a search based on the provided search criteria and, for each match call Collector.collect().
long searchCount(Query query, ApplicationUser searcher)
Return the number of issues matching the provided search criteria.
long searchCountOverrideSecurity(Query query, ApplicationUser searcher)
Return the number of issues matching the provided search criteria, overridding any security constraints.
void searchOverrideSecurity(Query query, ApplicationUser searcher, Collector collector)
Run a search based on the provided search criteria and, for each match, call Collector.collect() not taking into account any security constraints.
SearchResults searchOverrideSecurity(Query query, ApplicationUser searcher, PagerFilter pager, Query andQuery)
Search the index, and only return issues that are in the pager's range while AND'ing the raw lucene query to the generated query from the provided searchQuery, not taking into account any security constraints.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.search.SearchProvider

Public Constructors

public DualSearchProvider (LuceneSearchProvider luceneSearchProvider, DbSearchProvider dbSearchProvider, SearchHandlerManager searchHandlerManager, FeatureManager featureManager, InstrumentationListenerManager instrumentationListenerManager, InstrumentationLogger instrumentationLogger, CustomFieldManager customFieldManager)

Public Methods

public void search (Query query, ApplicationUser searcher, Collector collector, Query andQuery)

Run a search based on the provided search criteria and, for each match, call Collector.collect(). Collectors are low level Lucene classes, but they allow issues to be placed into buckets very quickly. Many of JIRA's graphs and stats are generated in this manner. This method is useful if you need to execute a query in constant-memory (i.e. you do not want to load the results of your complete search into memory) and the query generated via JQL needs to be augmented with some custom Lucene query.

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
collector the Lucene object that will have collect called for each match.
andQuery additional Lucene query to be anded with the lucene query that will be generated from JQL

public void search (Query query, ApplicationUser searcher, Collector collector)

Run a search based on the provided search criteria and, for each match, call Collector.collect(). Collectors are low level Lucene classes, but they allow issues to be placed into buckets very quickly. Many of JIRA's graphs and stats are generated in this manner. This method is useful if you need to execute a query in constant-memory (i.e. you do not want to load the results of your complete search into memory).

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
collector the Lucene object that will have collect called for each match.

public SearchResults search (Query query, ApplicationUser searcher, PagerFilter pager)

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 only after the number of search results use searchCount(Query, ApplicationUser) as it provides better performance.

Parameters
query contains the information required to perform the search.
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.
pager Pager filter (use getUnlimitedFilter() to get all issues).
Returns

public SearchResults search (Query query, ApplicationUser searcher, PagerFilter pager, Query andQuery)

Search the index, and only return issues that are in the pager's range while AND'ing the raw lucene query to the generated query from the provided searchQuery.

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 only after the number of search results use searchCount(Query, ApplicationUser) as it provides better performance.

Parameters
query contains the information required to perform the search.
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.
pager Pager filter (use getUnlimitedFilter() to get all issues).
andQuery raw lucene Query to AND with the request.
Returns

public void searchAndSort (Query query, ApplicationUser searcher, Collector collector, PagerFilter pager)

Run a search based on the provided search criteria and, for each match call Collector.collect(). This method is for Collectors that need the search results to be sorted.

Note: this is much slower than using search(Query, ApplicationUser, Collector).

You may limit the number of results being collected by the Collector using the PagerFilter parameter. This method is useful if you need to execute a query in constant-memory (i.e. you do not want to load the results of your complete search into memory).

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
collector the Lucene object that will have collect called for each match.
pager Pager filter (use getUnlimitedFilter() to get all issues).

public void searchAndSortOverrideSecurity (Query query, ApplicationUser searcher, Collector collector, PagerFilter pager)

Run a search based on the provided search criteria and, for each match call Collector.collect(). This method is for Collectors that need the search results to be sorted.

Do not use this method, user searchAndSort(Query, ApplicationUser, Collector, PagerFilter) instead, this should only be used when performing administrative tasks where you need to know ALL the issues that will be effected.

Note: this is much slower than using search(Query, ApplicationUser, Collector).

You may limit the number of results being collected by the Collector using the PagerFilter parameter. This method is useful if you need to execute a query in constant-memory (i.e. you do not want to load the results of your complete search into memory).

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
collector the Lucene object that will have collect called for each match.
pager Pager filter (use getUnlimitedFilter() to get all issues).

public long searchCount (Query query, ApplicationUser searcher)

Return the number of issues matching the provided search criteria. Note: This does not load all results into memory and provides better performance than search(Query, ApplicationUser, PagerFilter)

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
Returns
  • number of matching results.

public long searchCountOverrideSecurity (Query query, ApplicationUser searcher)

Return the number of issues matching the provided search criteria, overridding any security constraints.

Do not use this method, use searchCount(Query, ApplicationUser) instead, this should only be used when performing administrative tasks where you need to know ALL the issues that will be affected.

Note: This does not load all results into memory and provides better performance than search(Query, ApplicationUser, PagerFilter)

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
Returns
  • number of matching results.

public void searchOverrideSecurity (Query query, ApplicationUser searcher, Collector collector)

Run a search based on the provided search criteria and, for each match, call Collector.collect() not taking into account any security constraints.

Do not use this method, use search(Query, ApplicationUser, Collector) instead, this should only be used when performing administrative tasks where you need to know ALL the issues that will be affected.

Collectors are low level Lucene classes, but they allow issues to be placed into buckets very quickly. Many of JIRA's graphs and stats are generated in this manner. This method is useful if you need to execute a query in constant-memory (i.e. you do not want to load the results of your complete search into memory).

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
collector the Lucene object that will have collect called for each match.

public SearchResults searchOverrideSecurity (Query query, ApplicationUser searcher, PagerFilter pager, Query andQuery)

Search the index, and only return issues that are in the pager's range while AND'ing the raw lucene query to the generated query from the provided searchQuery, not taking into account any security constraints.

Do not use this method, user search(Query, ApplicationUser, PagerFilter, org.apache.lucene.search.Query) instead, this should only be used when performing administrative tasks where you need to know ALL the issues that will be affected.

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 only after the number of search results use searchCount(Query, ApplicationUser) as it provides better performance.

Parameters
query contains the information required to perform the search.
searcher the user performing the search which will be used to provide context for the search.
pager Pager filter (use getUnlimitedFilter() to get all issues).
andQuery raw lucene Query to AND with the request.
Returns