thomasmueller commented on code in PR #588:
URL: https://github.com/apache/jackrabbit-oak/pull/588#discussion_r891239604
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexDefinition.java:
##########
@@ -114,6 +117,7 @@ public class ElasticIndexDefinition extends IndexDefinition
{
public final int numberOfShards;
public final int numberOfReplicas;
public final int[] queryFetchSizes;
+ public final Integer trackTotalHits;
Review Comment:
Shouldn't this be "long" ?
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -272,7 +274,9 @@ public void onSuccess(SearchResponse<ObjectNode>
searchResponse) {
LOG.debug("Processing search response that took {} to read
{}/{} docs", searchResponse.took(), hitsSize, totalHits);
lastHitSortValues = searchHits.get(hitsSize - 1).sort();
scannedRows += hitsSize;
- anyDataLeft.set(totalHits > scannedRows);
+ if (searchResponse.hits().total().relation() ==
TotalHitsRelation.Eq) {
+ anyDataLeft.set(totalHits > scannedRows);
+ } else anyDataLeft.set(true);
Review Comment:
I find the following more easy to read:
} else {
anyDataLeft.set(true);
}
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexDefinition.java:
##########
@@ -63,6 +63,9 @@ public class ElasticIndexDefinition extends IndexDefinition {
public static final String QUERY_FETCH_SIZES = "queryFetchSizes";
public static final Long[] QUERY_FETCH_SIZES_DEFAULT = new Long[]{100L,
1000L};
+ public static final String TRACK_TOTAL_HITS = "trackTotalHits";
+ public static final Integer TRACK_TOTAL_HITS_DEFAULT = 100000;
Review Comment:
Shouldn't this be "long" ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]