com.atlassian.jira.issue.search
Interface SearchProvider

All Known Implementing Classes:
LuceneSearchProvider

public interface SearchProvider

A SearchProvider in JIRA allows users to run plain-text and arbitrary queries against data as opposed to database (SQL) based queries.


Method Summary
 List search(SearchRequest request, User searcher)
          Deprecated. - please use search(SearchRequest, com.opensymphony.user.User, com.atlassian.jira.web.bean.PagerFilter) instead.
 void search(SearchRequest request, User user, org.apache.lucene.search.HitCollector hitCollector)
          Create a search, and for each match, call hitCollector.collect().
 SearchResults search(SearchRequest request, User searcher, PagerFilter pager)
          Search the index, and only return issues that are in the pager's range.
 void searchAndSort(SearchRequest request, User user, DocumentHitCollector hitCollector, PagerFilter pagerFilter)
          For HitCollectors that need the search results to be sorted, use this method.
 long searchCount(SearchRequest request, User searcher)
          Return the number of issues matching a search request.
 

Method Detail

search

public List search(SearchRequest request,
                   User searcher)
            throws SearchException
Deprecated. - please use search(SearchRequest, com.opensymphony.user.User, com.atlassian.jira.web.bean.PagerFilter) instead.

Returns a list of GenericValue issue objects.

Throws:
SearchException

search

public SearchResults search(SearchRequest request,
                            User searcher,
                            PagerFilter pager)
                     throws SearchException
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(SearchRequest, com.opensymphony.user.User) as it provides better performance.

Parameters:
pager - Pager filter (use PagerFilter.getUnlimitedFilter() to get all issues).
Returns:
A SearchResults object which basically stores a list or resulting issues.
Throws:
SearchException

searchCount

public long searchCount(SearchRequest request,
                        User searcher)
                 throws SearchException
Return the number of issues matching a search request. Note: This does not load all results into memory and provides better performance than search(SearchRequest, com.opensymphony.user.User, com.atlassian.jira.web.bean.PagerFilter)

Returns:
Number of matching results.
Throws:
SearchException

search

public void search(SearchRequest request,
                   User user,
                   org.apache.lucene.search.HitCollector hitCollector)
            throws IOException,
                   SearchException
Create a search, and for each match, call hitCollector.collect(). HitCollectors 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).

Throws:
IOException
SearchException

searchAndSort

public void searchAndSort(SearchRequest request,
                          User user,
                          DocumentHitCollector hitCollector,
                          PagerFilter pagerFilter)
                   throws IOException,
                          SearchException
For HitCollectors that need the search results to be sorted, use this method. However, this is much slower than using search(SearchRequest, com.opensymphony.user.User, org.apache.lucene.search.HitCollector). You may limit the number of results being collected by the HitCollector 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).

Throws:
IOException
SearchException


Copyright © 2002-2007 Atlassian. All Rights Reserved.