public interface SolrOperations
Modifier and Type | Method and Description |
---|---|
void |
commit()
Send commit command
SolrClient.commit() |
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
|
long |
count(SolrDataQuery query,
RequestMethod method)
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> id)
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
|
<T> Collection<T> |
getById(Collection<? extends Serializable> ids,
Class<T> clazz)
Executes a realtime get using given ids.
|
<T> T |
getById(Serializable id,
Class<T> clazz)
Executes a realtime get using given id.
|
SolrConverter |
getConverter() |
org.apache.solr.client.solrj.SolrClient |
getSolrClient()
Get the underlying SolrClient instance
|
org.apache.solr.client.solrj.response.SolrPingResponse |
ping()
Execute ping against SolrClient and return duration in msec
|
<T> Cursor<T> |
queryForCursor(Query query,
Class<T> clazz)
|
<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> FacetPage<T> |
queryForFacetPage(FacetQuery query,
Class<T> clazz,
RequestMethod method)
Execute a facet query against solr facet result will be returned along with query result within the FacetPage
|
<T> GroupPage<T> |
queryForGroupPage(Query query,
Class<T> clazz)
Execute the query against solr and return result as
GroupPage |
<T> GroupPage<T> |
queryForGroupPage(Query query,
Class<T> clazz,
RequestMethod method)
Execute the query against solr and return result as
GroupPage |
<T> HighlightPage<T> |
queryForHighlightPage(HighlightQuery query,
Class<T> clazz)
Execute a query and highlight matches in result
|
<T> HighlightPage<T> |
queryForHighlightPage(HighlightQuery query,
Class<T> clazz,
RequestMethod method)
Execute a query and highlight matches in result
|
<T> T |
queryForObject(Query query,
Class<T> clazz)
Execute the query against solr and return the first returned object
|
<T> T |
queryForObject(Query query,
Class<T> clazz,
RequestMethod method)
Execute the query against solr and return the first returned object
|
<T> ScoredPage<T> |
queryForPage(Query query,
Class<T> clazz)
Execute the query against solr and retrun result as
Page |
<T> ScoredPage<T> |
queryForPage(Query query,
Class<T> clazz,
RequestMethod method)
Execute the query against solr and retrun result as
Page |
<T> StatsPage<T> |
queryForStatsPage(Query query,
Class<T> clazz)
Execute the query against Solr and return result as
StatsPage . |
<T> StatsPage<T> |
queryForStatsPage(Query query,
Class<T> clazz,
RequestMethod method)
Execute the query against Solr and return result as
StatsPage . |
TermsPage |
queryForTermsPage(TermsQuery query)
Execute query using terms handler
|
TermsPage |
queryForTermsPage(TermsQuery query,
RequestMethod method)
Execute query using terms handler
|
void |
rollback()
send rollback command
SolrClient.rollback() |
org.apache.solr.client.solrj.response.UpdateResponse |
saveBean(Object obj)
Execute add operation against solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveBean(Object obj,
int commitWithinMs)
Execute add operation against solr, which will do either insert or update with support for commitWithin strategy
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveBeans(Collection<?> beans)
Add a collection of beans to solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveBeans(Collection<?> beans,
int commitWithinMs)
Add a collection of beans to solr, which will do either insert or update with support for commitWithin strategy
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveDocument(org.apache.solr.common.SolrInputDocument document)
Add a solrj input document to solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveDocument(org.apache.solr.common.SolrInputDocument document,
int commitWithinMs)
Add a solrj input document to solr, which will do either insert or update with support for commitWithin strategy
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents)
Add multiple solrj input documents to solr, which will do either insert or update
|
org.apache.solr.client.solrj.response.UpdateResponse |
saveDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents,
int commitWithinMs)
Add multiple solrj input documents to solr, which will do either insert or update with support for commitWithin
strategy
|
void |
softCommit()
Send soft commmit command
SolrClient.commit(boolean, boolean, boolean) |
org.apache.solr.client.solrj.SolrClient getSolrClient()
org.apache.solr.client.solrj.response.SolrPingResponse ping()
long count(SolrDataQuery query)
query
- long count(SolrDataQuery query, RequestMethod method)
query
- method
- must not be null.org.apache.solr.client.solrj.response.UpdateResponse saveBean(Object obj)
obj
- org.apache.solr.client.solrj.response.UpdateResponse saveBean(Object obj, int commitWithinMs)
obj
- commitWithinMs
- org.apache.solr.client.solrj.response.UpdateResponse saveBeans(Collection<?> beans)
beans
- org.apache.solr.client.solrj.response.UpdateResponse saveBeans(Collection<?> beans, int commitWithinMs)
beans
- commitWithinMs
- org.apache.solr.client.solrj.response.UpdateResponse saveDocument(org.apache.solr.common.SolrInputDocument document)
document
- org.apache.solr.client.solrj.response.UpdateResponse saveDocument(org.apache.solr.common.SolrInputDocument document, int commitWithinMs)
document
- commitWithinMs
- org.apache.solr.client.solrj.response.UpdateResponse saveDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents)
documents
- org.apache.solr.client.solrj.response.UpdateResponse saveDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, int commitWithinMs)
documents
- org.apache.solr.client.solrj.response.UpdateResponse delete(SolrDataQuery query)
query
- org.apache.solr.client.solrj.response.UpdateResponse deleteById(String id)
id
- org.apache.solr.client.solrj.response.UpdateResponse deleteById(Collection<String> id)
id
- <T> T queryForObject(Query query, Class<T> clazz)
query
- clazz
- <T> T queryForObject(Query query, Class<T> clazz, RequestMethod method)
query
- clazz
- method
- must not be null.<T> ScoredPage<T> queryForPage(Query query, Class<T> clazz)
Page
query
- clazz
- <T> ScoredPage<T> queryForPage(Query query, Class<T> clazz, RequestMethod method)
Page
query
- must not be null.clazz
- must not be null.method
- must not be null.<T> FacetPage<T> queryForFacetPage(FacetQuery query, Class<T> clazz)
query
- clazz
- <T> FacetPage<T> queryForFacetPage(FacetQuery query, Class<T> clazz, RequestMethod method)
query
- clazz
- method
- must not be null.<T> HighlightPage<T> queryForHighlightPage(HighlightQuery query, Class<T> clazz)
query
- clazz
- <T> HighlightPage<T> queryForHighlightPage(HighlightQuery query, Class<T> clazz, RequestMethod method)
query
- clazz
- method
- must not be null.TermsPage queryForTermsPage(TermsQuery query)
query
- TermsPage queryForTermsPage(TermsQuery query, RequestMethod method)
query
- method
- must not be null.<T> Cursor<T> queryForCursor(Query query, Class<T> clazz)
Query
and returns an open Cursor
allowing to iterate of results, dynamically
fetching additional ones if required.query
- clazz
- <T> GroupPage<T> queryForGroupPage(Query query, Class<T> clazz)
GroupPage
query
- clazz
- <T> GroupPage<T> queryForGroupPage(Query query, Class<T> clazz, RequestMethod method)
GroupPage
query
- clazz
- method
- must not be null.<T> StatsPage<T> queryForStatsPage(Query query, Class<T> clazz)
StatsPage
.query
- must not be null.clazz
- must not be null.<T> StatsPage<T> queryForStatsPage(Query query, Class<T> clazz, RequestMethod method)
StatsPage
.query
- must not be null.clazz
- must not be null.method
- must not be null.<T> T getById(Serializable id, Class<T> clazz)
id
- <T> Collection<T> getById(Collection<? extends Serializable> ids, Class<T> clazz)
ids
- void commit()
SolrClient.commit()
void softCommit()
SolrClient.commit(boolean, boolean, boolean)
void rollback()
SolrClient.rollback()
org.apache.solr.common.SolrInputDocument convertBeanToSolrInputDocument(Object bean)
bean
- SolrConverter getConverter()
<T> T execute(SolrCallback<T> action)
action
- Copyright © 2011-2015–2017 Pivotal Software, Inc.. All rights reserved.