public interface SearchProvider
SearchService
instead,
which is part of jira-api and is decoupled from the Lucene library.
Use SearchProvider
if you need to
fieldsToLoad
query
by setting additional Lucene query
Collector
SearchService}
Modifier and Type | Method and Description |
---|---|
long |
getHitCount(SearchQuery query)
Return the number of documents that match the
query |
long |
getHitCount(SearchQuery query,
Long timeout)
Return the number of documents that match the
query |
void |
search(SearchQuery query,
org.apache.lucene.search.Collector collector)
Run a search against the Issue index with the
collector called for each document that matches the query . |
SearchResults<DocumentWithId> |
search(SearchQuery query,
PagerFilter pager)
Run a search against the Issue index, loading all fields for each document.
|
SearchResults<DocumentWithId> |
search(SearchQuery query,
PagerFilter pager,
Set<String> fieldsToLoad)
Run a search against the Issue index, loading only a restricted subset of fields for each document.
|
SearchResults<DocumentWithId> search(SearchQuery query, PagerFilter pager, Set<String> fieldsToLoad) throws SearchException
Query.getOrderByClause()
and Lucene scoring.query
- Query to define which Lucene documents should be returned.pager
- PagerFilter to restrict the portion of documents matching the query
that will be returned.fieldsToLoad
- Set of fields that should be loaded. Only these fields will be available in the returned
document
.
Empty set means only document id
will be loaded.SearchResults
with Lucene documents (and their internal ids) with only specific fields loadedSearchException
DocumentWithId
SearchResults<DocumentWithId> search(SearchQuery query, PagerFilter pager) throws SearchException
search(SearchQuery, PagerFilter, Set)
, loading only a subset of fields.
Query.getOrderByClause()
and Lucene scoring.query
- Query to define which Lucene documents should be returned.pager
- PagerFilter to restrict the portion of documents matching the query
that will be returned.SearchResults
with Lucene documents (and their internal ids) with all fields loadedSearchException
DocumentWithId
long getHitCount(SearchQuery query) throws SearchException
query
query
- Query to define which Lucene documents should be counted.SearchException
long getHitCount(SearchQuery query, Long timeout) throws SearchException
query
query
- Query to define which Lucene documents should be counted.timeout
- Query timeout in millisecondsSearchException
void search(SearchQuery query, org.apache.lucene.search.Collector collector) throws SearchException
collector
called for each document that matches the query
.
Query.getOrderByClause()
.
The collector
will be called according to Lucene's internal index structure.
The docIds passed to LeafCollector.collect(int)
are in order that is safe
to be used with DocValuesIterator.advanceExact(int)
method.
search(SearchQuery, PagerFilter)
and
search(SearchQuery, PagerFilter, Set)
, it does not load all returned documents into the memory at once.
For each result it calls LeafCollector.collect(int)
with the document id and leaves it up to the Collector
implementation
to decide what to do: load all or only specific fields, save just the document id, or ignore the given id completely.SearchException
Copyright © 2002-2022 Atlassian. All Rights Reserved.