Hi, Jörg,
I did some experiments following your advice. One issue is that: when
"_source" is disabled, when I get a document by its id, the original JSON
is not there. How am I supposed to get my data back with "_source" set to
false?
For example, I have
{
"mappings":{
"default":{
"_source": { "enabled": false },
"_all": { "enabled": false },
"dynamic_templates":[
{
"noindex": {
"match":"*",
"mapping": {
"index": "no"
}
}
}
]
}
}
}
Then, a GET returns the following. I cannot find the JSON data associated
with the id (usually, that is in the _source field).
{"_index":"keyvaluestore","_type":"001DC0B00F00","_id":"1","_version":1,"found":true}
For a key/value store, I need to be able to get the value back. Could you
give me some more suggestions?
Thanks,
Jingzhao
On Saturday, November 22, 2014 2:57:40 PM UTC-8, Jörg Prante wrote:
If you set "index: no" to all fields and disabled _all and _source, you
have low overhead because Lucene does not need to index or merge anything.
But your concerns are correct. Elasticsearch does not have in-place
updates, there is a tradeoff between time and space for that operation. If
you have a large number of deletes, you will notice slower response times.
If you have a large number of gets overweighing deletes, you can get
response times as memcached, once the data is loaded.
I recommend you set up a test cluster (with mlockall and large heap) and
find out the numbers for yourself.
Jörg
On Sat, Nov 22, 2014 at 8:16 PM, Jingzhao Ou <jingz...@gmail.com
<javascript:>> wrote:
Hi, all,
I am interested in using Elastic Search to replace memcached. That way, I
have one less software to maintain.
First of all, I learn that I can retrieve a doc by id right after writing
it into an index. There is no need to wait for indexing to finish.
Second, I set "index" to "no" in the mapping of the index reserved for
caching. I played with that and things work great. I can retrieve a doc by
id but nothing shows up when searching.
The last thing I worry is that: when updating a doc, Elastic Search
creates a new doc and marks the original doc for deletion. The actual
deletion happens during a merge. In that case, if I need to constantly
update a value in a cache, would it cause significant delays and/or
performance issues? Elastic Search may not perform as good as memcached,
but if things are not that case, I still want to do everything in Elastic
Search.
I appreciate your insights, especially on the last item.
Thanks a lot!
Jingzhao
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/680c222c-ede2-40cd-b3b8-323ac22fd660%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/680c222c-ede2-40cd-b3b8-323ac22fd660%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/13bb6e9e-f672-4c09-b518-8565876df383%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.