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"IOException
public void sendUpdate(String uri, SolrElementAdd data) throws IOException
IOException
public void sendUpdate(String uri, SolrElementAdd data, String encoding, String contentType) throws IOException
IOException
public 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
- IOException
XPathExpressionException
org.apache.commons.codec.EncoderException
public 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 seriesIdMalformedURLException
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.NotFound
org.apache.solr.client.solrj.SolrServerException
ParserConfigurationException
IOException
SAXException
XPathExpressionException
public List<SolrDoc> getDocumentById(String uir, String id) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOException
XPathExpressionException
org.apache.commons.codec.EncoderException
public List<SolrDoc> getDocumentsByResourceMap(String uir, String resourceMapId) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOException
XPathExpressionException
org.apache.commons.codec.EncoderException
public List<SolrDoc> getDocumentsByField(String uir, List<String> fieldValues, String queryField, boolean maxRows) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOException
XPathExpressionException
org.apache.commons.codec.EncoderException
public List<SolrDoc> getDocumentsByResourceMapFieldAndDocumentsField(String uir, String resourceMapId, String documentsId) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOException
XPathExpressionException
org.apache.commons.codec.EncoderException
public List<SolrDoc> getDocumentsByResourceMapFieldAndIsDocumentedByField(String uir, String resourceMapId, String isDocumentedById) throws IOException, XPathExpressionException, org.apache.commons.codec.EncoderException
IOException
XPathExpressionException
org.apache.commons.codec.EncoderException
public SolrDoc retrieveDocumentFromSolrServer(String id, String solrQueryUri) throws XPathExpressionException, IOException, org.apache.commons.codec.EncoderException
XPathExpressionException
IOException
org.apache.commons.codec.EncoderException
public void setSolrSchemaPath(String path)
public void setSolrIndexUri(String uri)
public String getSolrIndexUri()
public org.apache.http.client.HttpClient getHttpClient()
Copyright © 2022. All rights reserved.