Skip to content
Snippets Groups Projects
Commit 5843c45b authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

mc

parent 62939378
No related branches found
No related tags found
No related merge requests found
...@@ -444,25 +444,28 @@ public class OAIPMHUtilities { ...@@ -444,25 +444,28 @@ public class OAIPMHUtilities {
} }
/** /**
* @param theElasticSearchIndexToUse
* @param idInElasticSearchIndex The ID to get the ES record from. * @param idInElasticSearchIndex The ID to get the ES record from.
* @param includes Including the fields to fetch from the elastic search index. * @param includes Including the fields to fetch from the elastic search index.
* @param excludes Excluding the fields to fetch from the elastic search index. * @param excludes Excluding the fields to fetch from the elastic search index.
* @return * @return
* @throws IOException * @throws IOException
*/ */
protected static GetResponse getRcordByIDFromElasticSearch(String index, protected static GetResponse getRcordByIDFromElasticSearch(String theElasticSearchIndexToUse,
String idInElasticSearchIndex, String idInElasticSearchIndex, String[] includes, String[] excludes) throws IOException {
String[] includes, String[] excludes) throws IOException {
System.out.println("index: " + theElasticSearchIndexToUse);
System.out.println("id: " + idInElasticSearchIndex);
// Setting the source context for fetching the fields from the elastic search index // Setting the source context for fetching the fields from the elastic search index
FetchSourceContext fetchSourceContext = new FetchSourceContext(true, includes, excludes); FetchSourceContext fetchSourceContext = new FetchSourceContext(true, includes, excludes);
// Building the getRequest against the elastic search index // Building the getRequest against the elastic search index
GetRequest getRequest = GetRequest getRequest =
new GetRequest(index, OAI_ESClient.getEsType(), idInElasticSearchIndex) new GetRequest(theElasticSearchIndexToUse, OAI_ESClient.getEsType(), idInElasticSearchIndex)
.fetchSourceContext(fetchSourceContext); .fetchSourceContext(fetchSourceContext);
// Declaration of the result from the get-reuest // Declaration of the result from the get-request
GetResponse esResultObject = OAI_ESClient.getEsClient().get(getRequest, RequestOptions.DEFAULT); GetResponse esResultObject = OAI_ESClient.getEsClient().get(getRequest, RequestOptions.DEFAULT);
return esResultObject; return esResultObject;
......
...@@ -293,7 +293,6 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract { ...@@ -293,7 +293,6 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
} }
} }
/* /*
* public DublinCoreBuilder putContentIntoDCFieldLists(JSONObject json) { * public DublinCoreBuilder putContentIntoDCFieldLists(JSONObject json) {
* *
...@@ -350,6 +349,7 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract { ...@@ -350,6 +349,7 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
System.out.println("hit id: " + hit.getId()); System.out.println("hit id: " + hit.getId());
System.out.println("hit map keys: " + hit.getSourceAsMap().keySet()); System.out.println("hit map keys: " + hit.getSourceAsMap().keySet());
System.out.println("hit map vals: " + hit.getSourceAsMap().entrySet()); System.out.println("hit map vals: " + hit.getSourceAsMap().entrySet());
System.out.println("identifier list: " + this.identifierList);
result.setIdentifier( result.setIdentifier(
OAIPMHUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.identifierList)); OAIPMHUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.identifierList));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment