public class SimpleSolrTemplate extends java.lang.Object
Constructor and Description |
---|
SimpleSolrTemplate(org.apache.solr.client.solrj.SolrClient solrServer) |
Modifier and Type | Method and Description |
---|---|
org.apache.solr.client.solrj.response.UpdateResponse |
addBean(java.lang.Object obj) |
org.apache.solr.client.solrj.response.UpdateResponse |
addBeans(java.util.Collection<?> beans) |
org.apache.solr.client.solrj.response.UpdateResponse |
commit()
Invokes a "hard commit" to Solr index.
|
org.apache.solr.client.solrj.response.UpdateResponse |
deleteById(java.util.Collection<java.lang.String> ids)
Overloaded convenience method for passing a Collection instead of a list.
|
org.apache.solr.client.solrj.response.UpdateResponse |
deleteById(java.util.List<java.lang.String> ids) |
static <T> java.util.List<T> |
getList(org.apache.solr.client.solrj.response.QueryResponse response,
java.lang.Class<T> cls) |
static <T> java.util.List<T> |
getObjects(org.apache.solr.client.solrj.response.QueryResponse response,
java.lang.String fieldName,
java.lang.Class<T> cls) |
org.apache.solr.client.solrj.response.QueryResponse |
query(org.apache.solr.common.params.SolrParams params) |
<T> java.util.List<T> |
queryForList(org.apache.solr.common.params.SolrParams params,
java.lang.Class<T> cls) |
<T> java.util.List<T> |
queryForObjects(org.apache.solr.common.params.SolrParams params,
java.lang.String fieldName,
java.lang.Class<T> cls) |
public SimpleSolrTemplate(org.apache.solr.client.solrj.SolrClient solrServer)
solrServer
- public org.apache.solr.client.solrj.response.UpdateResponse addBean(java.lang.Object obj) throws org.apache.solr.common.SolrException
obj
- org.apache.solr.common.SolrException
public org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.util.Collection<?> beans) throws org.apache.solr.common.SolrException
beans
- org.apache.solr.common.SolrException
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.util.List<java.lang.String> ids) throws org.apache.solr.common.SolrException
ids
- org.apache.solr.common.SolrException
SolrClient.deleteById(java.util.List)
public org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.util.Collection<java.lang.String> ids) throws org.apache.solr.common.SolrException
ids
- org.apache.solr.common.SolrException
public org.apache.solr.client.solrj.response.UpdateResponse commit() throws org.apache.solr.common.SolrException
org.apache.solr.common.SolrException
public org.apache.solr.client.solrj.response.QueryResponse query(org.apache.solr.common.params.SolrParams params) throws org.apache.solr.common.SolrException
params
- org.apache.solr.common.SolrException
SolrClient.query(org.apache.solr.common.params.SolrParams)
public <T> java.util.List<T> queryForObjects(org.apache.solr.common.params.SolrParams params, java.lang.String fieldName, java.lang.Class<T> cls) throws org.apache.solr.common.SolrException
params
- fieldName
- cls
- org.apache.solr.common.SolrException
public static <T> java.util.List<T> getObjects(org.apache.solr.client.solrj.response.QueryResponse response, java.lang.String fieldName, java.lang.Class<T> cls) throws java.lang.IllegalArgumentException
response
- fieldName
- cls
- java.lang.IllegalArgumentException
public <T> java.util.List<T> queryForList(org.apache.solr.common.params.SolrParams params, java.lang.Class<T> cls) throws org.apache.solr.common.SolrException
params
- cls
- type of the beansorg.apache.solr.common.SolrException
public static <T> java.util.List<T> getList(org.apache.solr.client.solrj.response.QueryResponse response, java.lang.Class<T> cls)
response
- cls
- Copyright © 2015 Tampere University of Technology, Pori Department.