@@ -279,18 +279,18 @@ protected void html(LuceneIndex index, HttpServletRequest request, HttpServletRe
279279 }
280280
281281 int nextDoc = 0 ;
282+
282283 // sorted?
283284 String sort = pars .getString (SORT , SCORE , Set .of (SCORE , DATE ), SORT );
284285 // relevance
285286 if (DATE .equals (sort )) {
286287 SpanWalker walker = new SpanWalker (index .searcher (), spanQuery , filterQuery , results );
287- writer
288- .append ("<p class=\" statshits\" >" )
289- .append (String .valueOf (walker .hits ()))
290- .append (" documents " )
291- .append (String .valueOf (System .currentTimeMillis () - t0 ))
292- .append ("ms" )
293- .append ("</p>\n " );
288+ writer .append ("<p class=\" statshits\" >" );
289+ final int hitsCount = walker .hits ();
290+ if (docs < hitsCount ) writer .append (String .valueOf (docs )).append ("/" );
291+ writer .append (String .valueOf (hitsCount ))
292+ .append (" documents " )
293+ .append ("</p>\n " );
294294 writer .flush ();
295295 nextDoc = walker .walk (from );
296296 } else {
@@ -303,6 +303,7 @@ protected void html(LuceneIndex index, HttpServletRequest request, HttpServletRe
303303 } else {
304304 query = spanQuery ;
305305 }
306+ final int hitsCount = index .searcher ().count (query );
306307 ScoreDoc [] hits = index .searcher ().search (query , docs ).scoreDocs ;
307308
308309 final FieldStats fieldStats = fluc .fieldStats ();
@@ -318,12 +319,11 @@ protected void html(LuceneIndex index, HttpServletRequest request, HttpServletRe
318319 spans ,
319320 ctx );
320321
321- writer
322- .append ("<p class=\" statshits\" >" )
323- .append (String .valueOf (hits .length ))
324- .append (" documents " )
325- .append (String .valueOf (System .currentTimeMillis () - t0 ))
326- .append ("ms</p>\n " );
322+ writer .append ("<p class=\" statshits\" >" );
323+ if (docs < hitsCount ) writer .append (String .valueOf (docs )).append ("/" );
324+ writer .append (String .valueOf (hitsCount ))
325+ .append (" documents " )
326+ .append ("</p>\n " );
327327 writer .flush ();
328328
329329 for (ScoreDoc sd : hits ) {
0 commit comments