removed harvestedAfter since is not possible to use for the current index data-model

This commit is contained in:
Sandro La Bruzzo 2022-05-03 14:05:52 +02:00
parent 7abf6af997
commit a9a8559b53
4 changed files with 19 additions and 8 deletions

View File

@ -50,7 +50,7 @@ public class ScholixControllerV1 extends AbstractDnetController {
final int currentPage = page != null ? page : 0;
Pair<Long, List<Scholix>> scholixResult =manager.linksFromPid(null,null,null,publisher,
null,null,null,null,null,null, currentPage
null,null,null,null,null, currentPage
);
List<Scholix> scholixData = scholixResult.getValue();
if (scholixData== null)
@ -75,7 +75,7 @@ public class ScholixControllerV1 extends AbstractDnetController {
final int currentPage = page != null ? page : 0;
Pair<Long, List<Scholix>> scholixResult =manager.linksFromPid(datasource,null,null,null,
null,null,null,null,null,null, currentPage
null,null,null,null,null, currentPage
);
List<Scholix> scholixData = scholixResult.getValue();
if (scholixData== null)
@ -101,7 +101,7 @@ public class ScholixControllerV1 extends AbstractDnetController {
final int currentPage = page != null ? page : 0;
Pair<Long, List<Scholix>> scholixResult =manager.linksFromPid(datasourceTarget,null,null,null,
typologyTarget,pid,pidType,null,null,null, currentPage
typologyTarget,pid,pidType,null,null, currentPage
);
List<Scholix> scholixData = scholixResult.getValue();
if (scholixData== null)

View File

@ -54,8 +54,6 @@ public class ScholixControllerV2 extends AbstractDnetController {
description = "Filter Scholix relationships having a source published in a Publisher named sourcePublisher") String sourcePublisher,
@Parameter(in = ParameterIn.QUERY,
description = "Filter Scholix relationships having a source type (literature, dataset, unknown)") String sourceType,
@Parameter(in = ParameterIn.QUERY,
description = "Filter scholix Links having collected after this date") String harvestedAfter,
@Parameter(in = ParameterIn.QUERY,
description = "select page of result") Integer page) throws Exception {
@ -64,7 +62,7 @@ public class ScholixControllerV2 extends AbstractDnetController {
try {
final int currentPage = page != null ? page : 0;
Pair<Long, List<Scholix>> scholixResult = manager.linksFromPid( linkProvider, targetPid, targetPidType, targetPublisher, targetType, sourcePid, sourcePidType, sourcePublisher, sourceType, harvestedAfter, currentPage);
Pair<Long, List<Scholix>> scholixResult = manager.linksFromPid( linkProvider, targetPid, targetPidType, targetPublisher, targetType, sourcePid, sourcePidType, sourcePublisher, sourceType, currentPage);
final PageResultType pageResult = new PageResultType();
pageResult.setTotalPages(scholixResult.getLeft().intValue() / 10);
pageResult.setTotalLinks(scholixResult.getLeft().intValue());

View File

@ -8,6 +8,8 @@ import io.micrometer.core.annotation.Timed;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.lucene.queryparser.flexible.standard.builders.TermRangeQueryNodeBuilder;
import org.apache.lucene.search.TermRangeQuery;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.RestHighLevelClient;
@ -101,6 +103,11 @@ public class ScholixIndexManager {
return new NestedQueryBuilder(String.format("%s.publisher", prefix), new TermQueryBuilder(String.format("%s.publisher.name",prefix), publisher), ScoreMode.None);
}
private QueryBuilder createHarvestedAfterQuery(final String aDate) throws ScholixException {
return new RangeQueryBuilder("HarvestDate").gt(aDate);
}
private QueryBuilder createPidValueQuery(final RelationPrefix prefix, final String pidValue ) throws ScholixException{
if (prefix == null){
throw new ScholixException("prefix cannot be null");
@ -238,7 +245,7 @@ public class ScholixIndexManager {
public Pair<Long,List<Scholix>> linksFromPid ( final String linkProvider,
final String targetPid, final String targetPidType, final String targetPublisher,
final String targetType, final String sourcePid, final String sourcePidType,
final String sourcePublisher, final String sourceType, final String harvestedAfter,
final String sourcePublisher, final String sourceType,
final Integer page) throws ScholixException {
@ -294,6 +301,12 @@ public class ScholixIndexManager {
QueryBuilder result = createFinalQuery(queries);
NativeSearchQuery finalQuery = new NativeSearchQueryBuilder()
.withQuery(result)
.withPageable(PageRequest.of(page,10))

View File

@ -398,7 +398,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.plugin.version>3.6.0</maven.compiler.plugin.version>
<java.version>1.8</java.version>
<dhp-schemas-version>2.10.30-SCHOLEXPLORER-SNAPSHOT</dhp-schemas-version>
<dhp-schemas-version>2.11.33</dhp-schemas-version>
<apache.solr.version>7.1.0</apache.solr.version>
<mongodb.driver.version>3.4.2</mongodb.driver.version>
<springfox-version>2.8.0</springfox-version>