public class SolrTemplate extends Object implements SolrOperations, InitializingBean, ApplicationContextAware
Constructor and Description |
---|
SolrTemplate(org.apache.solr.client.solrj.SolrServer solrServer) |
SolrTemplate(SolrServerFactory solrServerFactory) |
SolrTemplate(SolrServerFactory solrServerFactory,
SolrConverter solrConverter) |
SolrTemplate(org.apache.solr.client.solrj.SolrServer solrServer,
String core) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected void |
assertNoCollection(Object o) |
void |
commit()
Send commit command
|
org.apache.solr.common.SolrInputDocument |
convertBeanToSolrInputDocument(Object bean)
Convert given bean into a solrj InputDocument
|
long |
count(SolrDataQuery query)
return number of elements found by for given query
|
org.apache.solr.client.solrj.response.UpdateResponse |
delete(SolrDataQuery query)
Find and delete all objects matching the provided Query
|
org.apache.solr.client.solrj.response.UpdateResponse |
deleteById(Collection<String> ids)
Delete objects with given ids
|
org.apache.solr.client.solrj.response.UpdateResponse |
deleteById(String id)
Detele the one object with provided id
|
<T> T |
execute(SolrCallback<T> action)
Execute action within callback
|
SolrConverter |
getConverter() |
static PersistenceExceptionTranslator |
getExceptionTranslator() |
org.apache.solr.client.solrj.SolrServer |
getSolrServer()
Get the underlying SolrServer instance
|
org.apache.solr.client.solrj.response.SolrPingResponse |
ping()
Execute ping against solrServer and return duration in msec
|
<T> FacetPage<T> |
queryForFacetPage(FacetQuery query,
Class<T> clazz)
Execute a facet query against solr facet result will be returned along with query result within the FacetPage
|
<T> T |
queryForObject(Query query,
Class<T> clazz)
Execute the query against solr and return the first returned object
|
<T> Page<T> |
queryForPage(Query query,
Class<T> clazz)
Execute the query against solr and retrun result as
Page |
void |
rollback()
send rollback command
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveBean(Object objectToAdd)
Execute add operation against solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveBeans(Collection<?> beansToAdd)
Add a collection of beans to solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveDocument(org.apache.solr.common.SolrInputDocument documentToAdd)
Add a solrj input document to solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveDocuments(Collection<org.apache.solr.common.SolrInputDocument> documentsToAdd)
Add multiple solrj input documents to solr, which will do either insert or update
|
void |
setApplicationContext(ApplicationContext applicationContext) |
public SolrTemplate(org.apache.solr.client.solrj.SolrServer solrServer)
public SolrTemplate(org.apache.solr.client.solrj.SolrServer solrServer, String core)
public SolrTemplate(SolrServerFactory solrServerFactory)
public SolrTemplate(SolrServerFactory solrServerFactory, SolrConverter solrConverter)
public <T> T execute(SolrCallback<T> action)
SolrOperations
execute
in interface SolrOperations
public org.apache.solr.client.solrj.response.SolrPingResponse ping()
SolrOperations
ping
in interface SolrOperations
public long count(SolrDataQuery query)
SolrOperations
count
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse saveBean(Object objectToAdd)
SolrOperations
saveBean
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse saveBeans(Collection<?> beansToAdd)
SolrOperations
saveBeans
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse saveDocument(org.apache.solr.common.SolrInputDocument documentToAdd)
SolrOperations
saveDocument
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse saveDocuments(Collection<org.apache.solr.common.SolrInputDocument> documentsToAdd)
SolrOperations
saveDocuments
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse delete(SolrDataQuery query)
SolrOperations
delete
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(String id)
SolrOperations
deleteById
in interface SolrOperations
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(Collection<String> ids)
SolrOperations
deleteById
in interface SolrOperations
public <T> T queryForObject(Query query, Class<T> clazz)
SolrOperations
queryForObject
in interface SolrOperations
public <T> Page<T> queryForPage(Query query, Class<T> clazz)
SolrOperations
Page
queryForPage
in interface SolrOperations
public <T> FacetPage<T> queryForFacetPage(FacetQuery query, Class<T> clazz)
SolrOperations
queryForFacetPage
in interface SolrOperations
public void commit()
SolrOperations
commit
in interface SolrOperations
public void rollback()
SolrOperations
rollback
in interface SolrOperations
public org.apache.solr.common.SolrInputDocument convertBeanToSolrInputDocument(Object bean)
SolrOperations
convertBeanToSolrInputDocument
in interface SolrOperations
protected void assertNoCollection(Object o)
public final org.apache.solr.client.solrj.SolrServer getSolrServer()
SolrOperations
getSolrServer
in interface SolrOperations
public SolrConverter getConverter()
getConverter
in interface SolrOperations
public static PersistenceExceptionTranslator getExceptionTranslator()
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.