Commit 8d26549a authored by neelesh thakur's avatar neelesh thakur
Browse files

track accurate total count if requested

parent 781f9984
Pipeline #34412 failed with stages
in 33 minutes and 32 seconds
......@@ -44,7 +44,7 @@
<log4j-core.version>2.13.2</log4j-core.version>
<google-oauth-client.version>1.31.0</google-oauth-client.version>
<commons-compress.version>1.20</commons-compress.version>
<osdu.oscorecommon.version>0.6.9</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.8.1</osdu.oscorecommon.version>
</properties>
<licenses>
......
......@@ -39,7 +39,7 @@
<aws.version>1.11.637</aws.version>
<deployment.environment>dev</deployment.environment>
<version.number>0.0.4-SNAPSHOT</version.number>
<osdu.oscorecommon.version>0.6.9</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.8.1</osdu.oscorecommon.version>
</properties>
<dependencies>
......
......@@ -242,6 +242,7 @@ abstract class QueryBase {
sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit()));
sourceBuilder.query(queryBuilder);
sourceBuilder.timeout(REQUEST_TIMEOUT);
sourceBuilder.trackTotalHits(request.isTrackTotalCount());
// set highlighter
if (request.isReturnHighlightedFields()) {
......
......@@ -37,7 +37,7 @@
<project.main.basedir>${project.parent.basedir}</project.main.basedir>
<springboot.version>2.1.7.RELEASE</springboot.version>
<osdu.corelibazure.version>0.0.41</osdu.corelibazure.version>
<osdu.oscorecommon.version>0.6.9</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.8.1</osdu.oscorecommon.version>
<osdu.search-core.version>0.8.0-SNAPSHOT</osdu.search-core.version>
<spatial4j.version>0.7</spatial4j.version>
<jts-io-common.version>1.15.0</jts-io-common.version>
......
......@@ -245,6 +245,7 @@ abstract class QueryBase {
sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit()));
sourceBuilder.query(queryBuilder);
sourceBuilder.timeout(REQUEST_TIMEOUT);
sourceBuilder.trackTotalHits(request.isTrackTotalCount());
// set highlighter
if (request.isReturnHighlightedFields()) {
......
......@@ -48,7 +48,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.0.18</version>
<version>0.8.1</version>
</dependency>
<dependency>
......
......@@ -198,6 +198,7 @@ abstract class QueryBase {
sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit()));
sourceBuilder.query(queryBuilder);
sourceBuilder.timeout(REQUEST_TIMEOUT);
sourceBuilder.trackTotalHits(request.isTrackTotalCount());
// set highlighter
if (request.isReturnHighlightedFields()) {
......
......@@ -54,7 +54,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.6.9</version>
<version>0.8.1</version>
</dependency>
<dependency>
......
......@@ -248,6 +248,7 @@ abstract class QueryBase {
sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit()));
sourceBuilder.query(queryBuilder);
sourceBuilder.timeout(requestTimeout);
sourceBuilder.trackTotalHits(request.isTrackTotalCount());
// set highlighter
if (request.isReturnHighlightedFields()) {
......
......@@ -25,7 +25,7 @@
<properties>
<os-core-lib-ibm.version>0.7.1</os-core-lib-ibm.version>
<start-class>org.opengroup.osdu.search.provider.ibm.app.SearchIBMApplication</start-class>
<osdu.oscorecommon.version>0.6.9</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.8.1</osdu.oscorecommon.version>
</properties>
......
......@@ -232,6 +232,7 @@ abstract class QueryBase {
sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit()));
sourceBuilder.query(queryBuilder);
sourceBuilder.timeout(REQUEST_TIMEOUT);
sourceBuilder.trackTotalHits(request.isTrackTotalCount());
// set highlighter
if (request.isReturnHighlightedFields()) {
......
......@@ -33,7 +33,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.3.8</version>
<version>0.8.1</version>
</dependency>
<dependency>
......
......@@ -20,27 +20,34 @@ package org.opengroup.osdu.search.provider.reference.di;
import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory;
import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory;
import org.opengroup.osdu.search.provider.reference.security.EntitlementsConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
import javax.inject.Inject;
@Component
@RequestScope
public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlementsFactory> {
@Autowired
private EntitlementsConfig entitlementsConfig;
@Value("${AUTHORIZE_API}")
private String AUTHORIZE_API;
@Override
protected IEntitlementsFactory createInstance() throws Exception {
@Value("${AUTHORIZE_API_KEY:}")
private String AUTHORIZE_API_KEY;
@Inject
private HttpResponseBodyMapper httpResponseBodyMapper;
@Override
protected IEntitlementsFactory createInstance() {
return new EntitlementsFactory(EntitlementsAPIConfig
.builder()
.rootUrl(entitlementsConfig.getAuthorizeApi())
.build());
.rootUrl(AUTHORIZE_API)
.apiKey(AUTHORIZE_API_KEY)
.build(), httpResponseBodyMapper);
}
@Override
......
......@@ -258,6 +258,7 @@ abstract class QueryBase {
sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit()));
sourceBuilder.query(queryBuilder);
sourceBuilder.timeout(REQUEST_TIMEOUT);
sourceBuilder.trackTotalHits(request.isTrackTotalCount());
// set highlighter
if (request.isReturnHighlightedFields()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment