I have a Solr index, which host 4 millions document and whose size is 65 Gb. When I browse my index using the web UI everything is fast. But my real queries, which are made of about 2000 Term (all coming from the same field), are way too slow.
To increase the speed of my Solr queries I first copied the index into my RAM which makes things much faster but still I need to increase the speed.
I also have created a multi-threaded version of my query, using Java7 RecursiveTask, where I basically divide the number of query terms by 2 until the number of query terms pass below a threshold. Then I aggregate the results of the sub-queries to build a final response. It makes things faster but it creates other kind of problems.
Here is the code I use for the multiple terms query
MultiPhraseQuery query = new MultiPhraseQuery();
query.add(queryTerms); // where queryTerms is an array of Term
TopDocs tops = searcher.search(query, rows);
ScoreDoc[] scoreDoc = tops.scoreDocs;
Does anyone has some nice suggestions to improve the speed performance ? Thank you