public class SolrClient extends Object
HttpClient for all HTTP communication.| Constructor and Description |
|---|
SolrClient(String url)
Constructor initializes the Solr URL
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Method to commit the current changes to the Solr index.
|
String |
delete(String id,
boolean commit)
Method to send a message containing a 'delete' instruction to Solr.
|
String |
index(List<String> docs,
boolean commit,
String mimeType)
Method to send one or more documents to be indexed to Solr.
|
String |
query(Map<String,String[]> parameters,
String mimeType)
Method to send a generic query to the Solr server.
|
String |
queryProductById(String id,
String mimeType)
Method to query the Solr index for a product with the specified id.
|
String |
queryProductByName(String name,
String mimeType)
Method to query the Solr index for a product with the specified name.
|
String |
queryProductsByDate(int n,
String mimeType)
Method to query Solr for the most recent 'n' products.
|
String |
queryProductsByDateAndType(int n,
ProductType type,
String mimeType)
Method to query Solr for the most recent 'n' products of a specified type.
|
public SolrClient(String url)
url - public String index(List<String> docs, boolean commit, String mimeType) throws CatalogException
docs - commit - mimeType - : the mime-type format of the documentsCatalogExceptionpublic String delete(String id, boolean commit) throws CatalogException
id - commit - CatalogExceptionpublic String queryProductById(String id, String mimeType) throws CatalogException
id - CatalogExceptionpublic String queryProductByName(String name, String mimeType) throws CatalogException
name - mimeType - CatalogExceptionpublic String queryProductsByDate(int n, String mimeType) throws CatalogException
n - CatalogExceptionpublic String queryProductsByDateAndType(int n, ProductType type, String mimeType) throws CatalogException
n - CatalogExceptionpublic void commit()
throws IOException,
CatalogException
ExceptionIOExceptionCatalogExceptionpublic String query(Map<String,String[]> parameters, String mimeType) throws CatalogException
parameters - mimeType - : the desired mime type for the results (XML, JSON, ...)CatalogExceptionCopyright © 1999–2017 Apache OODT. All rights reserved.