elasticsearch index as a key/object storage

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

elasticsearch index as a key/object storage

Eugene Strokin
Hello,
one of my index doesn't need any searching. All I need there is just to get document's source by ID. Document is a free structure, could have any kind of fields which I don't know upfront.
Could you please help me with mapping? Strangely, I couldn't find any way to say: don't index my document no matter structure it would be, just store it with some ID.
Thanks in advance,
Eugene

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: elasticsearch index as a key/object storage

ppearcy
Hey,
  You should do the following:
- Disable dynamic mapping when you create the index (index.mapper.dynamic == 0)
- Enable storing of the _source

That should be it. You will the need to use the GET API to access.

Best Regards,
Paul


On Tuesday, January 29, 2013 10:12:08 AM UTC-7, Eugene Strokin wrote:
Hello,
one of my index doesn't need any searching. All I need there is just to get document's source by ID. Document is a free structure, could have any kind of fields which I don't know upfront.
Could you please help me with mapping? Strangely, I couldn't find any way to say: don't index my document no matter structure it would be, just store it with some ID.
Thanks in advance,
Eugene

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: elasticsearch index as a key/object storage

Eugene Strokin
Thank you Paul.
Just wanted to share an example for somebody who would have same question later:

Here how you create such index:

curl -XPUT 'http://localhost:9200/MyIndexName/' -d '
{
   "index": {
      "mapper": {
         "dynamic": false
     
},
      "number_of_shards": 5,
      "number_of_replicas": 1
  }
}'



Correct me if I'm wrong, but looks like it works.
Thanks,
Eugene


On Tuesday, January 29, 2013 12:48:21 PM UTC-5, ppearcy wrote:
Hey,
  You should do the following:
- Disable dynamic mapping when you create the index (index.mapper.dynamic == 0)
- Enable storing of the _source

That should be it. You will the need to use the GET API to access.

Best Regards,
Paul


On Tuesday, January 29, 2013 10:12:08 AM UTC-7, Eugene Strokin wrote:
Hello,
one of my index doesn't need any searching. All I need there is just to get document's source by ID. Document is a free structure, could have any kind of fields which I don't know upfront.
Could you please help me with mapping? Strangely, I couldn't find any way to say: don't index my document no matter structure it would be, just store it with some ID.
Thanks in advance,
Eugene

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: elasticsearch index as a key/object storage

Clinton Gormley-2
On Tue, 2013-01-29 at 13:12 -0800, Eugene Strokin wrote:
> Thank you Paul.
> Just wanted to share an example for somebody who would have same
> question later:

I'd consider setting the "enabled" property on the default mapping
instead:

curl -XPUT 'http://127.0.0.1:9200/my_index/?pretty=1'  -d '
{
   "mappings" : {
      "_default_" : {
         "enabled" : false
      }
   }
}
'

clint



--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.