public class HTTPService extends Object
| Constructor and Description |
|---|
HTTPService(org.springframework.http.client.HttpComponentsClientHttpRequestFactory requestFactory) |
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeQueryChars(String s)
Borrowed from
http://www.docjar.com/html/api/org/apache/solr/client/solrj/
util/ClientUtils.java.html
|
List<SolrDoc> |
getDocumentById(String uir,
String id) |
SolrDoc |
getDocumentBySeriesId(String seriesId,
String uir)
Gets a single solr document that is at the top of the version chain for the given seriesId
|
List<SolrDoc> |
getDocumentsByField(String uir,
List<String> fieldValues,
String queryField,
boolean maxRows) |
List<SolrDoc> |
getDocumentsById(String uir,
List<String> ids)
Return the SOLR records for the specified PIDs
|
List<SolrDoc> |
getDocumentsByResourceMap(String uir,
String resourceMapId) |
List<SolrDoc> |
getDocumentsByResourceMapFieldAndDocumentsField(String uir,
String resourceMapId,
String documentsId) |
List<SolrDoc> |
getDocumentsByResourceMapFieldAndIsDocumentedByField(String uir,
String resourceMapId,
String isDocumentedById) |
org.apache.http.client.HttpClient |
getHttpClient() |
String |
getSolrIndexUri() |
SolrDoc |
retrieveDocumentFromSolrServer(String id,
String solrQueryUri) |
void |
sendSolrDelete(String pid) |
void |
sendSolrDeletes(List<String> pids) |
void |
sendUpdate(String uri,
SolrElementAdd data) |
void |
sendUpdate(String uri,
SolrElementAdd data,
String encoding)
Posts document data to Solr indexer.
|
void |
sendUpdate(String uri,
SolrElementAdd data,
String encoding,
String contentType) |
void |
setSolrIndexUri(String uri) |
void |
setSolrSchemaPath(String path) |
public HTTPService(org.springframework.http.client.HttpComponentsClientHttpRequestFactory requestFactory)
public void sendUpdate(String uri, SolrElementAdd data, String encoding) throws IOException
uri - Solr index url example:
http://localhost:8080/solr/update?commit=truedata - documents to indexencoding - use "UTF-8"IOExceptionpublic void sendUpdate(String uri, SolrElementAdd data) throws IOException
IOExceptionpublic void sendUpdate(String uri, SolrElementAdd data, String encoding, String contentType) throws IOException
IOExceptionpublic void sendSolrDelete(String pid)
public static String escapeQueryChars(String s)
s - public List<SolrDoc> getDocumentsById(String uir, List<String> ids) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
uir - ids - IOExceptionXPathExpressionExceptionorg.apache.commons.codec.EncoderExceptionpublic SolrDoc getDocumentBySeriesId(String seriesId, String uir) throws MalformedURLException, org.dataone.service.exceptions.UnsupportedType, org.dataone.service.exceptions.NotFound, org.apache.solr.client.solrj.SolrServerException, ParserConfigurationException, IOException, SAXException, XPathExpressionException
seriesId - - the target object's seriesIdMalformedURLExceptionorg.dataone.service.exceptions.UnsupportedTypeorg.dataone.service.exceptions.NotFoundorg.apache.solr.client.solrj.SolrServerExceptionParserConfigurationExceptionIOExceptionSAXExceptionXPathExpressionExceptionpublic List<SolrDoc> getDocumentById(String uir, String id) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOExceptionXPathExpressionExceptionorg.apache.commons.codec.EncoderExceptionpublic List<SolrDoc> getDocumentsByResourceMap(String uir, String resourceMapId) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOExceptionXPathExpressionExceptionorg.apache.commons.codec.EncoderExceptionpublic List<SolrDoc> getDocumentsByField(String uir, List<String> fieldValues, String queryField, boolean maxRows) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOExceptionXPathExpressionExceptionorg.apache.commons.codec.EncoderExceptionpublic List<SolrDoc> getDocumentsByResourceMapFieldAndDocumentsField(String uir, String resourceMapId, String documentsId) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOExceptionXPathExpressionExceptionorg.apache.commons.codec.EncoderExceptionpublic List<SolrDoc> getDocumentsByResourceMapFieldAndIsDocumentedByField(String uir, String resourceMapId, String isDocumentedById) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOExceptionXPathExpressionExceptionorg.apache.commons.codec.EncoderExceptionpublic SolrDoc retrieveDocumentFromSolrServer(String id, String solrQueryUri) throws XPathExpressionException, IOException, org.apache.commons.codec.EncoderException
XPathExpressionExceptionIOExceptionorg.apache.commons.codec.EncoderExceptionpublic void setSolrSchemaPath(String path)
public void setSolrIndexUri(String uri)
public String getSolrIndexUri()
public org.apache.http.client.HttpClient getHttpClient()
Copyright © 2022. All rights reserved.