@DeclareRoles(value={"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) @RolesAllowed(value={"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) public class LuceneSearchService extends Object implements SearchService
escpeSearchTerm.
This method prepends a \ for those characters that QueryParser expects to be
escaped.did-not-update-the-index-when-called-from-a-web-modul| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_SEARCH_RESULT |
static int |
DEFAULT_PAGE_SIZE |
| Constructor and Description |
|---|
LuceneSearchService() |
| Modifier and Type | Method and Description |
|---|---|
int |
getTotalHits(String _searchTerm,
int _maxResult,
DefaultOperator defaultOperator)
Returns the total hits for a given search term from the lucene index.
|
List<ItemCollection> |
search(String searchTerm,
int pageSize,
int pageIndex,
SortOrder sortOrder,
DefaultOperator defaultOperator,
boolean loadStubs)
Returns a collection of documents matching the provided search term.
|
public static final int DEFAULT_MAX_SEARCH_RESULT
public static final int DEFAULT_PAGE_SIZE
public List<ItemCollection> search(String searchTerm, int pageSize, int pageIndex, SortOrder sortOrder, DefaultOperator defaultOperator, boolean loadStubs) throws QueryException
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.
search in interface SearchServicesearchTerm - pageSize - - docs per pagepageIndex - - page numbersortOrder - defaultOperator - - optional to change the default search operatorloadStubs - - optional indicates of only the lucene document should be returned.QueryException - in case the searchtem is not understandable.public int getTotalHits(String _searchTerm, int _maxResult, DefaultOperator defaultOperator) throws QueryException
getTotalHits in interface SearchServicesSearchTerm - maxResult - - max search resultQueryException - in case the searchterm is not understandable.search(String, int, int, Sort, Operator)Copyright © 2006–2020 Imixs Software Solutions GmbH. All rights reserved.