Package org.imixs.workflow.engine.index
Interface SearchService
- All Known Implementing Classes:
LuceneSearchService
,SolrSearchService
public interface SearchService
This SearchService defines methods to search workitems or collections of
workitems.
- Version:
- 1.0
- Author:
- rsoika
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptiongetTaxonomy
(String... categories) Returns the total hits for a given set of categories from the lucene taxonomy index.getTaxonomyByQuery
(String searchTerm, String... categories) Returns the total hits for a given set of categories from the lucene taxonomy index based on a search query.int
getTotalHits
(String _searchTerm, int _maxResult, DefaultOperator defaultOperator) Returns the total hits for a given search term from the lucene index.search
(String searchTerm, int pageSize, int pageIndex, SortOrder sortOrder, DefaultOperator defaultOperator, boolean loadStubs) Returns a collection of documents matching the provided search term.
-
Field Details
-
DEFAULT_MAX_SEARCH_RESULT
static final int DEFAULT_MAX_SEARCH_RESULT- See Also:
-
DEFAULT_PAGE_SIZE
static final int DEFAULT_PAGE_SIZE- See Also:
-
-
Method Details
-
search
List<ItemCollection> search(String searchTerm, int pageSize, int pageIndex, SortOrder sortOrder, DefaultOperator defaultOperator, boolean loadStubs) throws QueryException Returns a collection of documents matching the provided search term. The term will be extended with the current users roles to test the read access level of each workitem matching the search term.The optional param 'searchOrder' can be set to force lucene to sort the search result by any search order.
The optional param 'defaultOperator' can be set to Operator.AND
The optional param 'stubs' indicates if the full Imixs Document should be loaded or if only the data fields stored in the lucedn index will be return. The later is the faster method but returns only document stubs.
- Parameters:
searchTerm
-pageSize
- - docs per pagepageIndex
- - page numbersortOrder
- - optional to sort the resultdefaultOperator
- - optional to change the default search operatorloadStubs
- - optional indicates of only the lucene document should be returned.- Returns:
- collection of search result
- Throws:
QueryException
- in case the searchtem is not understandable.
-
getTotalHits
int getTotalHits(String _searchTerm, int _maxResult, DefaultOperator defaultOperator) throws QueryException Returns the total hits for a given search term from the lucene index. The method did not load any data. The provided search term will be extended with a users roles to test the read access level of each workitem matching the search term. The optional param 'maxResult' can be set to overwrite the DEFAULT_MAX_SEARCH_RESULT.- Parameters:
sSearchTerm
-maxResult
- - max search result- Returns:
- total hits of search result
- Throws:
QueryException
- in case the searchterm is not understandable.- See Also:
-
search(String, int, int, Sort, Operator)
-
getTaxonomy
Returns the total hits for a given set of categories from the lucene taxonomy index. The method did not load any data.- Parameters:
categories
- - a list of categories.- Returns:
- total hits of search result
- Throws:
QueryException
- in case the searchterm is not understandable.
-
getTaxonomyByQuery
Returns the total hits for a given set of categories from the lucene taxonomy index based on a search query. The method did not load any data.- Parameters:
searchTerm
- - a lucene search termcategories
- - a list of categories.- Returns:
- total hits of search result
- Throws:
QueryException
- in case the searchterm is not understandable.
-