#8737 - make elastic fetch 100 inner hits instead of the default 3.

This commit is contained in:
Bernaldo Mihasi 2023-06-21 12:05:51 +03:00
parent 3d367b0589
commit dfa2f0cd38
5 changed files with 6 additions and 2 deletions

View File

@ -146,7 +146,7 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
}
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.Avg).innerHit(new InnerHitBuilder().setFetchSourceContext(new FetchSourceContext(true, new String[]{"datasets.tags"}, null)));
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.Avg).innerHit(new InnerHitBuilder().setFetchSourceContext(new FetchSourceContext(true, new String[]{"datasets.tags"}, null)).setSize(this.environment.getProperty("elasticsearch.innerHitsSize", Integer.class)));
searchSourceBuilder.query(nestedQueryBuilder)/*.from(criteria.getOffset())*/.fetchSource("datasets.tags", null);
/*if (criteria.getSize() > 0) {
searchSourceBuilder.size(criteria.getSize());
@ -206,7 +206,7 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
}
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.None).innerHit(new InnerHitBuilder().setFetchSourceContext(new FetchSourceContext(true, new String[]{"datasets.id"}, null)));
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.None).innerHit(new InnerHitBuilder().setFetchSourceContext(new FetchSourceContext(true, new String[]{"datasets.id"}, null)).setSize(this.environment.getProperty("elasticsearch.innerHitsSize", Integer.class)));
searchSourceBuilder.query(nestedQueryBuilder)/*.from(criteria.getOffset()).size(criteria.getSize())*/.fetchSource("datasets.id", null);
sortBuilders.forEach(searchSourceBuilder::sort);
searchRequest.source(searchSourceBuilder);

View File

@ -14,6 +14,7 @@ elasticsearch.port = 9200
elasticsearch.username=elastic
elasticsearch.password=
elasticsearch.index=dmps
elasticsearch.innerHitsSize=100
####################ELK OVERRIDES CONFIGURATIONS##########
http-logger.server-address = http://localhost:31311

View File

@ -14,6 +14,7 @@ elasticsearch.index=dmps
elasticsearch.usingssl=false
elasticsearch.certPath=
elasticsearch.certKey=
elasticsearch.innerHitsSize=100
####################ELK OVERRIDES CONFIGURATIONS##########
#http-logger.server-address = http://logstash:31311

View File

@ -11,6 +11,7 @@ elasticsearch.port = 9200
elasticsearch.username=elastic
elasticsearch.password=
elasticsearch.index=dmps
elasticsearch.innerHitsSize=100
####################PDF OVERRIDES CONFIGURATIONS##########
pdf.converter.url=http://docsbox-web/

View File

@ -46,6 +46,7 @@ elasticsearch.index=
elasticsearch.usingssl=false
elasticsearch.certPath=
elasticsearch.certKey=
elasticsearch.innerHitsSize=100
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
configuration.externalUrls=externalUrls/ExternalUrls.xml