3 October 2011

How to store index in memory in elasticsearch?

Solutions works* for elasticsearch 0.13.1 and higher ( and probably for lower version,but i haven't checked)

 If you want  index to be stored in memory then
If you use  yml config :
     type: memory

If you use json config
"store": {
  "type": "memory"

If you curl extreme fanatic :

If elasticsearch is run from commandline in linux: :
bin/elasticsearch -f -Xmx2g -Xms2g -Des.index.storage.type=memory
* Do NOT use this, if you using local gateway (which is the default settings as well!),because it will not work correctly.,because   kmichy (creator of elasticsearch,who getting moody, when people ask him about solr)  said on elasticsearch that: "If you use index.store.type set to memory (which has some problems in the implementation that I have not tracked yet), then using local gateway (the default) will not work. Once you create an index with settings, they are set to those settings, so if you kill elasticsearch and start it again (with local gateway), you will get failures. If you want a clean elasticsearch instance, delete teh data dir."