Elasticsearch performance questions


I'm currently struggling with understanding how es works.

  • if i make a search a lot of times with the same bool query, will it be optimized ? does es have some kind of caching mechanism ? my query has a couple of parameters, between which some ids. if I change one id at each search, will it be slower than leaving the query unchanged ?
  • I quess searching is just not very clear to me, sorry if this is a dump question.
  • I've noticed that the less shards a node holds, the less memory it consumes; what is the dropdown of adding more nodes then, besides the networking; I'm trying to decide if I should add 3 or 5 nodes for a production cluster

  • I've noticed than when indexing/querying a cluster, the heap memory used goes up until a certain point when it goes down again; I couldn't connect this with the garbage collector's actions; is it the lucene merging process or something else? can someone please explain to me what I'm missing ?