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

mc

parent 67bdcbcc
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,9 @@ import info.textgrid.middleware.common.TextGridMimetypes;
public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
private static final int lifeTimeResToken = 100;
private static final String DH_ES_DIVIDER = ".";
private static org.apache.commons.logging.Log log =
LogFactory.getLog(IdentifierListDelivererDC.class);
public static Map<String, Integer> cursorCollector = new Hashtable<String, Integer>();
......@@ -49,7 +52,6 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
private String dateOfObjectCreation; // Field for the object creation in the repository
private String repositoryObjectURIPrefix; //
private String identifierField;
private static final int lifeTimeResToken = 100;
private int searchResponseSize;
private long resultSize;
......@@ -122,11 +124,9 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
// TODO: necessary?
FetchSourceContext fetchSourceContext = new FetchSourceContext(true, includes, excludes);
SearchRequest searchRequest =
new SearchRequest(OAI_ESClient.getEsIndex()).searchType(SearchType.QUERY_THEN_FETCH);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.query(query);
searchSourceBuilder.size(this.searchResponseSize);
......@@ -188,13 +188,33 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
System.out.println(" ## dateOfObjectCreation --> " + this.dateOfObjectCreation);
// Get date field.
if (this.dateOfObjectCreation.contains(DH_ES_DIVIDER)) {
// Divide date object.
String dateOfObjectCreationDivider[] = this.dateOfObjectCreation.split(DH_ES_DIVIDER);
String prefix = dateOfObjectCreationDivider[0];
String suffix = dateOfObjectCreationDivider[1];
if (hit.getSourceAsMap().containsKey(prefix)) {
System.out.println(" ## argl --> " + hit.getSourceAsMap().get(prefix));
// this.datestamp =
}
} else {
this.datestamp = hit.getSourceAsMap().get(this.dateOfObjectCreation).toString();
}
// Get identifier field.
System.out.println(" ## entries --> " + hit.getSourceAsMap().entrySet());
System.out.println(" ## " + this.dateOfObjectCreation + "(" + hit.getId() + ") --> "
+ (hit.getSourceAsMap().get(this.dateOfObjectCreation) == null ? "NULL"
: hit.getSourceAsMap().get(this.dateOfObjectCreation)));
System.out.println(" ## containsKey --> "
+ hit.getSourceAsMap().containsKey(this.dateOfObjectCreation));
+ hit.getSourceAsMap().keySet().contains(this.dateOfObjectCreation));
System.out
.println(" ## get --> " + hit.getSourceAsMap().get(this.dateOfObjectCreation));
System.out.println(" ## innerHits --> " + hit.getInnerHits());
......
......@@ -9,12 +9,7 @@ RS_ENDPOINT = https://textgridlab.org/1.0/tgoaipmh
############################
elasticSearch.url = 127.0.0.1
<<<<<<< HEAD
elasticSearch.port = 9302
elasticSearch.clusterName = tg-esx2-instance
=======
elasticSearch.ports = 9202 9203
>>>>>>> feature/elastic6
elasticSearch.index = textgrid-public
elasticSearch.type = metadata
elasticSearch.itemLimit = 100
......
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