@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 SolrSearchService extends Object implements SearchService
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_SEARCH_RESULT |
static int |
DEFAULT_PAGE_SIZE |
| Constructor and Description |
|---|
SolrSearchService() |
| 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.
|
protected List<ItemCollection> |
parseQueryResult(String json)
This method extracts the docs from a Solr JSON query result
|
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
In Solr we can get the count if we the the query param 'row=0'. The the response contains still the numFound but not docs!
getTotalHits in interface SearchServicesSearchTerm - maxResult - - max search resultQueryException - in case the searchterm is not understandable.protected List<ItemCollection> parseQueryResult(String json)
json - - solr query response (JSON)Copyright © 2006–2020 Imixs Software Solutions GmbH. All rights reserved.