Integrated: JDK-8294109: JavaDoc search should search whole index

Hannes Wallnöfer hannesw at openjdk.org
Fri Nov 4 16:04:00 UTC 2022


On Wed, 28 Sep 2022 17:47:10 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

> Please review a simple change in JavaDoc search to always search the whole index. Currently we stop searching when the number of results in a category reaches the maximum number of results (500 per category). This can lead to results being omitted that should be ranked very high in the result list.
> 
> With this change, we always search the full index, then sort the results according to their ranking and only then trim the result to the maximum number of results per category. 
> 
> Since stopping the search early was partly done for performance reasons I did test the performance impact of the change. On my computer, searching the index of the JDK documentation is still very fast, searching the biggest index (members) with lots of matches still takes less than 50 milliseconds. On my phone it is already a bit above 100 milliseconds, which is still ok (the other index files are much smaller and faster). 
> 
> However, while measuring performance I noticed that by far the biggest impact on performance is the rendering of the result list. We currently show at most 500 results per category, which is a lot - probably more than anybody would scroll through looking for a result. I therefore changed the maximum number of results per category to 300. It's still more than enough, and it makes the result list a bit easier to manage and faster to render on slow devices. 
> 
> The change in the test is not really related to this change, the test was broken due to an earlier change in script.js (the test is skipped by default and needs to be run manually).

This pull request has now been integrated.

Changeset: f9c7cdae
Author:    Hannes Wallnöfer <hannesw at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f9c7cdaed693934a366145b15dcbb2aa65a9da0a
Stats:     6 lines in 2 files changed: 3 ins; 0 del; 3 mod

8294109: JavaDoc search should search whole index

Reviewed-by: jjg

-------------

PR: https://git.openjdk.org/jdk/pull/10470


More information about the javadoc-dev mailing list