public class SolrSearchEngine extends Object implements SearchEngine
Application.Component.LifecycleState| Constructor and Description |
|---|
SolrSearchEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Collection<SearchInputDocument> docs)
Add documents to the search index.
|
void |
add(SearchInputDocument... docs)
Add documents to the search index.
|
void |
commit()
Explicitly commit all pending changes, and wait until they are visible to
the search.
|
void |
commit(boolean wait)
Explicitly commit all pending changes, and optionally wait until they are
visible to the search.
|
SearchInputDocument |
createInputDocument()
Create a SearchInputDocument that can be populated and added to the
index.
|
SearchQuery |
createQuery()
Create a SearchQuery that can be populated and used for searching.
|
SearchQuery |
createQuery(String queryText)
Convenience method to create a SearchQuery and set the query text in one
step.
|
void |
deleteById(Collection<String> ids)
Delete documents from the search index, by unique ID.
|
void |
deleteById(String... ids)
Delete documents from the search index, by unique ID.
|
void |
deleteByQuery(String query)
Delete documents from the search index if they satisfy the query.
|
int |
documentCount()
Find the number of documents in the search index.
|
void |
ping()
Check to see whether the SearchEngine is alive.
|
SearchResponse |
query(SearchQuery query)
Query the search index and return the results.
|
void |
shutdown(Application application)
This should be called only once, and should be the last call on this
Component.
|
void |
startup(Application application,
ComponentStartupStatus css)
Set up the http connection with the solr server
|
public void startup(Application application, ComponentStartupStatus css)
startup in interface Application.Componentpublic void shutdown(Application application)
Application.Componentshutdown in interface Application.Componentpublic void ping()
throws SearchEngineException
SearchEngineping in interface SearchEngineSearchEngineException - if the SearchEngine does not respond.public SearchInputDocument createInputDocument()
SearchEnginecreateInputDocument in interface SearchEnginepublic void add(SearchInputDocument... docs) throws SearchEngineException
SearchEngineadd in interface SearchEngineSearchEngineExceptionpublic void add(Collection<SearchInputDocument> docs) throws SearchEngineException
SearchEngineadd in interface SearchEngineSearchEngineExceptionpublic void commit()
throws SearchEngineException
SearchEnginecommit in interface SearchEngineSearchEngineExceptionpublic void commit(boolean wait)
throws SearchEngineException
SearchEnginecommit in interface SearchEngineSearchEngineExceptionpublic void deleteById(String... ids) throws SearchEngineException
SearchEnginedeleteById in interface SearchEngineSearchEngineExceptionpublic void deleteById(Collection<String> ids) throws SearchEngineException
SearchEnginedeleteById in interface SearchEngineSearchEngineExceptionpublic void deleteByQuery(String query) throws SearchEngineException
SearchEnginedeleteByQuery in interface SearchEngineSearchEngineExceptionpublic SearchQuery createQuery()
SearchEnginecreateQuery in interface SearchEnginepublic SearchQuery createQuery(String queryText)
SearchEnginecreateQuery in interface SearchEnginepublic SearchResponse query(SearchQuery query) throws SearchEngineException
SearchEnginequery in interface SearchEngineSearchEngineExceptionpublic int documentCount()
throws SearchEngineException
SearchEnginedocumentCount in interface SearchEngineSearchEngineExceptionCopyright © 2021. All rights reserved.