I have an index(es 2.2) with 1 shard and 15.6M documents (will go up to 100M in the future) and I'm doing searches on it but they take ~500ms (too much time in my opinion).
I don't store the _source, I don't store fields, just want the ids from es.
I have 1 node with 64GB ram intel-xeon-E5-1630v3 that is only running es+nginx for proxy. I changed the heap to 30GB and optimized to 1 segment (~3.7GB).
Things that I use in the query are: term filters, function_score (weight functions), multi_match on 4 fields with different weights,
I currently put everything in 1 shard since it's a little hard to make a right _routing value, I could make it from a "program_id" field witch I'm usually filtering on, but one program has 5M docs, while other programs have from 1K to 2.5M, so maybe the distribution of documents will make some shard much bigger compared to others and that may be a problem.
My wish, is to make this as fast as possible, since in my best-case-scenario I will have thousands requests/second. Of course with alot of replicas, but I need the single-query to be fast first.