# Leave content in mySQL and use ElasticSearch only for Index

**URL:** <https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115>\
**Category:** Elasticsearch\
**Created:** [August 6, 2014, 11:21am UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115 "2014-08-06T11:21:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aseknoppik](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@aseknoppik](https://discuss.elastic.co/u/aseknoppik)\
**Post date:** [August 6, 2014, 11:21am UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115/1 "2014-08-06T11:21:09Z")

</div>

Hello,

I want to use Elasticsearch or only indexing and searching E-Mails. We want  
to store the meta-info within Elasticsearch, keeping the content/body of  
every Mail in an mySQL database. So Elasticsearch shall have a reference to  
the mail body.

Is that possible and how?

Regards  
Michael

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/928f30a8-31fd-456c-a527-e2e51ebd69f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/928f30a8-31fd-456c-a527-e2e51ebd69f4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 6, 2014, 11:48am UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115/2 "2014-08-06T11:48:22Z")

</div>

Have a look at the JDBC plugin. With that plugin, you can push metadata  
from MySQL to Elasticsearch.

> **[GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-jdbc)**
>
> JDBC importer for Elasticsearch. Contribute to jprante/elasticsearch-jdbc development by creating an account on GitHub.

Jörg

On Wed, Aug 6, 2014 at 1:21 PM, [aseknoppik@gmail.com](mailto:aseknoppik@gmail.com) wrote:

> Hello,
> 
> I want to use Elasticsearch or only indexing and searching E-Mails. We  
> want to store the meta-info within Elasticsearch, keeping the content/body  
> of every Mail in an mySQL database. So Elasticsearch shall have a reference  
> to the mail body.
> 
> Is that possible and how?
> 
> Regards  
> Michael
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/928f30a8-31fd-456c-a527-e2e51ebd69f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/928f30a8-31fd-456c-a527-e2e51ebd69f4%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/928f30a8-31fd-456c-a527-e2e51ebd69f4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/928f30a8-31fd-456c-a527-e2e51ebd69f4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGP6w%2BxS%2BQLoBR9r2q6tz\_iz1rez1zAE%2B3j56WgFnSTKQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGP6w%2BxS%2BQLoBR9r2q6tz_iz1rez1zAE%2B3j56WgFnSTKQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![aseknoppik](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@aseknoppik](https://discuss.elastic.co/u/aseknoppik)\
**Post date:** [August 6, 2014, 1:34pm UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115/3 "2014-08-06T13:34:10Z")

</div>

Using this plugin would lead to a migration from mysql data into  
Elasticsearch.

So let me reformulate my question:

My infrastructure is like this:

client----\>Elasticsearch  
|  
|  
--------\>mySQL

So I have a client which generates an index and some metadata for a  
mail(header and body). The mail is stored in mySQL. And the client-side  
generated index and metadata is stored in Elasticsearch.

The reason is because I have \> 1 TB of mail content every day. This content  
shall still be written to mySQL. Elasticsearch shall keep only the index.  
Is that possible? And how?

Regards  
Michael

Am Mittwoch, 6. August 2014 13:21:09 UTC+2 schrieb [asekn...@gmail.com](mailto:asekn...@gmail.com):

> Hello,
> 
> I want to use Elasticsearch or only indexing and searching E-Mails. We  
> want to store the meta-info within Elasticsearch, keeping the content/body  
> of every Mail in an mySQL database. So Elasticsearch shall have a reference  
> to the mail body.
> 
> Is that possible and how?
> 
> Regards  
> Michael

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bb04102a-9aca-469d-8145-d5e644481d39%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bb04102a-9aca-469d-8145-d5e644481d39%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Andrej](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Andrej](https://discuss.elastic.co/u/Andrej)\
**Post date:** [August 6, 2014, 1:48pm UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115/4 "2014-08-06T13:48:10Z")

</div>

What I don't understand is why you generate an index and want to store it  
in elasticsearch. You could use the plugin as Jörg suggested, transfer you  
data to elasticsearch, set index:true for the fields you want and set  
store:false in the mapping. This way you get an index build by  
elasticsearch, can search on it, get the id as result and the data is not  
stored (except metadata, if you set it to be stored). See  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#mapping-core-types).

Cheers,  
Andrej

Am Mittwoch, 6. August 2014 15:34:11 UTC+2 schrieb [asekn...@gmail.com](mailto:asekn...@gmail.com):

> Using this plugin would lead to a migration from mysql data into  
> Elasticsearch.
> 
> So let me reformulate my question:
> 
> My infrastructure is like this:
> 
> client----\>Elasticsearch  
> |  
> |  
> --------\>mySQL
> 
> So I have a client which generates an index and some metadata for a  
> mail(header and body). The mail is stored in mySQL. And the client-side  
> generated index and metadata is stored in Elasticsearch.
> 
> The reason is because I have \> 1 TB of mail content every day. This  
> content shall still be written to mySQL. Elasticsearch shall keep only the  
> index. Is that possible? And how?
> 
> Regards  
> Michael
> 
> Am Mittwoch, 6. August 2014 13:21:09 UTC+2 schrieb [asekn...@gmail.com](mailto:asekn...@gmail.com):
> 
> > Hello,
> > 
> > I want to use Elasticsearch or only indexing and searching E-Mails. We  
> > want to store the meta-info within Elasticsearch, keeping the content/body  
> > of every Mail in an mySQL database. So Elasticsearch shall have a reference  
> > to the mail body.
> > 
> > Is that possible and how?
> > 
> > Regards  
> > Michael

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d1ffc059-abad-4b11-8179-35ed3c077cbf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1ffc059-abad-4b11-8179-35ed3c077cbf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 6, 2014, 3:52pm UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115/5 "2014-08-06T15:52:08Z")

</div>

JDBC plugin is not for migration.

It can be configured to select the data from the RDBMS you want. You can  
fetch the metadata fields and index them into Elasticsearch with a simple  
SQL select statement.

Jörg

On Wed, Aug 6, 2014 at 3:48 PM, Andrej Rosenheinrich \<  
[andrej.rosenheinrich@unister.de](mailto:andrej.rosenheinrich@unister.de)\> wrote:

> What I don't understand is why you generate an index and want to store it  
> in elasticsearch. You could use the plugin as Jörg suggested, transfer you  
> data to elasticsearch, set index:true for the fields you want and set  
> store:false in the mapping. This way you get an index build by  
> elasticsearch, can search on it, get the id as result and the data is not  
> stored (except metadata, if you set it to be stored). See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#mapping-core-types)  
> .
> 
> Cheers,  
> Andrej
> 
> Am Mittwoch, 6. August 2014 15:34:11 UTC+2 schrieb [asekn...@gmail.com](mailto:asekn...@gmail.com):
> 
> > Using this plugin would lead to a migration from mysql data into  
> > Elasticsearch.
> > 
> > So let me reformulate my question:
> > 
> > My infrastructure is like this:
> > 
> > client----\>Elasticsearch  
> > |  
> > |  
> > --------\>mySQL
> > 
> > So I have a client which generates an index and some metadata for a  
> > mail(header and body). The mail is stored in mySQL. And the client-side  
> > generated index and metadata is stored in Elasticsearch.
> > 
> > The reason is because I have \> 1 TB of mail content every day. This  
> > content shall still be written to mySQL. Elasticsearch shall keep only the  
> > index. Is that possible? And how?
> > 
> > Regards  
> > Michael
> > 
> > Am Mittwoch, 6. August 2014 13:21:09 UTC+2 schrieb [asekn...@gmail.com](mailto:asekn...@gmail.com):
> > 
> > > Hello,
> > > 
> > > I want to use Elasticsearch or only indexing and searching E-Mails. We  
> > > want to store the meta-info within Elasticsearch, keeping the content/body  
> > > of every Mail in an mySQL database. So Elasticsearch shall have a reference  
> > > to the mail body.
> > > 
> > > Is that possible and how?
> > > 
> > > Regards  
> > > Michael
> > 
> > --  
> > 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d1ffc059-abad-4b11-8179-35ed3c077cbf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1ffc059-abad-4b11-8179-35ed3c077cbf%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/d1ffc059-abad-4b11-8179-35ed3c077cbf%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d1ffc059-abad-4b11-8179-35ed3c077cbf%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFRoWCW1ea-ZXr%2B9VfLzFDSvtenP8xHX35Tyi6Q6zDwSw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFRoWCW1ea-ZXr%2B9VfLzFDSvtenP8xHX35Tyi6Q6zDwSw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:10am UTC](https://discuss.elastic.co/t/leave-content-in-mysql-and-use-elasticsearch-only-for-index/19115/6 "2017-07-06T01:10:25Z")

</div>


