Open vladak opened 7 years ago
this smells like too many string allocation happening, resp. we do page search in UI, json might not do that ...
resp. maxresults seems no to get considered ... lucene 7.0 has some fixes in this regard, but we should fix this in current code too
Both searchSingleDatabase()
and searchMultiDatabase()
use collector for the results like this:
191 collector = TopScoreDocCollector.create(hitsPerPage * cachePages);
192 searcher.search(query, collector);
where the collector parameters come from Configuration
rather than from the request. Still, by default the values of these parameters are 125 and 5 respectively so it is a bit surprising that JVM ran out of space.
for new lucene this should be done in a better way (we have it in 2 places after recently Chris also fixed this in Searchengine) this old code needs a bit of improvement ...
new way should be something like: https://github.com/oracle/opengrok/blob/master/src/org/opensolaris/opengrok/history/DirectoryHistoryReader.java#L118
Just for the record, this has been moved to http://grok/source/api/v1/search?full=foo
Performing JSON search across all projects (https://mygrok/source/json?freetext=foo&maxresults=80 - note there is no
project
parameter) which results in:most probably due to large number of search hits being returned.
The Tomcat server is running with:
This does not happen when searching across all projects in the web UI (got some 500k hits).