Skip to content

Commit 1fc33d2

Browse files
committed
Add total hits to the search slow log
This commit adds the total hits to the search slow log.
1 parent 98ad259 commit 1fc33d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/src/main/java/org/elasticsearch/index/SearchSlowLog.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ static final class SlowLogSearchContextPrinter {
149149
@Override
150150
public String toString() {
151151
StringBuilder sb = new StringBuilder();
152-
sb.append(context.indexShard().shardId()).append(" ");
153-
sb.append("took[").append(TimeValue.timeValueNanos(tookInNanos)).append("], took_millis[").append(TimeUnit.NANOSECONDS.toMillis(tookInNanos)).append("], ");
152+
sb.append(context.indexShard().shardId())
153+
.append(" ")
154+
.append("took[").append(TimeValue.timeValueNanos(tookInNanos)).append("], ")
155+
.append("took_millis[").append(TimeUnit.NANOSECONDS.toMillis(tookInNanos)).append("], ")
156+
.append("total_hits[").append(context.queryResult().getTotalHits()).append("], ");
154157
if (context.getQueryShardContext().getTypes() == null) {
155158
sb.append("types[], ");
156159
} else {

0 commit comments

Comments
 (0)