I've installed the Lucene plugin on a test version of OJS and indexed about 40,000 docs. Unfortunately, search speed is still not as good as I would expect. I've performed some benchmarks where I've performed the same search in both the OJS interface and directly in Solr and the problem seems to be on the OJS side of thing.
The following table shows a comparison of searches in OJS and in Solr. The first column is the search term, the second the number of results, while the third and fourth are the time in milliseconds taken in Solr and OJS respectively. For OJS I've taken the time from the Network panel of the Firefox Developer tools, while for Solr I've taken it from the response header.
Term | Results | Solr | OJS
Kolding | 1514| 372 | 3108
Herning | 1022 | 298 | 2699
gallagher | 16 | 474 | 2605
strik | 66 | 880 | 4038
grønland | 1439 | 797 | 2714
samfund | 5180 | 839 | 2792
rasmussen | 3383 | 190 | 1914
Solr is takes on average 550 ms to carry out a search, while OJS take on average 2840 ms to do the same search, i.e. an additional 2300 ms of processing. So I'm wondering, what is OJS spending all this time on? One answer is that it's doing a hell of a lot of database queries. If I turn debug to On in my config, I can see that on average 2130 SELECT queries are being done for each of the searches. This seems like a huge number! About 1786 of these consist of direct queries to section_settings in the form "SELECT * FROM section_settings WHERE section_id = X". So it seems that these are all being called one after another, after the "SELECT * FROM sections ORDER BY journal_id, seq" query.
Therefore I would like to ask, what is the purpose of these queries? Can they be removed without incident? If not, can they be optimised in the form "SELECT * SETTINGS section_settings WHERE section_id IN (x,y,z)"? Finally, am I missing something else that can be easily optimised to improve OJS search performance?