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 documentsCatalogException
public String delete(String id, boolean commit) throws CatalogException
id
- commit
- CatalogException
public String queryProductById(String id, String mimeType) throws CatalogException
id
- CatalogException
public String queryProductByName(String name, String mimeType) throws CatalogException
name
- mimeType
- CatalogException
public String queryProductsByDate(int n, String mimeType) throws CatalogException
n
- CatalogException
public String queryProductsByDateAndType(int n, ProductType type, String mimeType) throws CatalogException
n
- CatalogException
public void commit() throws IOException, CatalogException
Exception
IOException
CatalogException
public String query(Map<String,String[]> parameters, String mimeType) throws CatalogException
parameters
- mimeType
- : the desired mime type for the results (XML, JSON, ...)CatalogException
Copyright © 1999–2017 Apache OODT. All rights reserved.