# River Plugin should wait until a specific mapping is added and then it should index the documents

**URL:** <https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576>\
**Category:** Elasticsearch\
**Created:** [November 25, 2013, 1:06pm UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576 "2013-11-25T13:06:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isabella](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@Isabella](https://discuss.elastic.co/u/Isabella)\
**Post date:** [November 25, 2013, 1:06pm UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576/1 "2013-11-25T13:06:35Z")

</div>

Hello!

I have to create a river plugin that index documents from a  
PostgreSQL database. My problem is that my plugin should wait until a  
specific mapping is added and then it should index the documents.

Is there any possibility to do this, or how can I tell the plugin that it  
should wait until the mapping is added?

Thanks a lot!

Best regards,

Isabella

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [November 25, 2013, 1:56pm UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576/2 "2013-11-25T13:56:30Z")

</div>

Thanks for the enhancement request. I have openend an issue

> <https://github.com/jprante/elasticsearch-jdbc/issues/140>

Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Isabella](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@Isabella](https://discuss.elastic.co/u/Isabella)\
**Post date:** [November 26, 2013, 3:21pm UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576/3 "2013-11-26T15:21:32Z")

</div>

Hello!

I have one more question regarding the mappings. Does anyone know if there  
is a possibility to get all mappings, that are defined in ES via Java API?  
So I would like to receive all defined mappings, but without specifying the  
index name or the type name. I didn't found anything in the ES  
documentation.

Thanks a lot.

Best regards,  
Isabella

Am Montag, 25. November 2013 14:56:30 UTC+1 schrieb Jörg Prante:

> Thanks for the enhancement request. I have openend an issue  
> [waiting for new index / new type before river starts · Issue #140 · jprante/elasticsearch-jdbc · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/issues/140)[https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fissues%2F140&sa=D&sntz=1&usg=AFQjCNHA-tecOwvd9D1xOoC0Cw7x9kRCrQ](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fissues%2F140&sa=D&sntz=1&usg=AFQjCNHA-tecOwvd9D1xOoC0Cw7x9kRCrQ)
> 
> Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [November 26, 2013, 7:10pm UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576/4 "2013-11-26T19:10:43Z")

</div>

For an example, look  
at org.elasticsearch.rest.action.admin.indices.mapping.get.RestGetMappingAction

The trick is to issue a cluster state request

```
    ClusterStateRequest clusterStateRequest =

```

Requests.clusterStateRequest()  
.filterRoutingTable(true)  
.filterNodes(true);

In the returned result, all indices and mappings can be filtered out.

Jörg

--  
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/CAKdsXoG0AmZnFMuSoLxdFJCU4Dzh%2BtSUArJ9r3GPOx%3DrLjSHZg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG0AmZnFMuSoLxdFJCU4Dzh%2BtSUArJ9r3GPOx%3DrLjSHZg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Isabella](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@Isabella](https://discuss.elastic.co/u/Isabella)\
**Post date:** [November 27, 2013, 10:52am UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576/5 "2013-11-27T10:52:22Z")

</div>

Thanks a lot for your answer. It works!

Isabella

Am Dienstag, 26. November 2013 20:10:43 UTC+1 schrieb Jörg Prante:

> For an example, look  
> at org.elasticsearch.rest.action.admin.indices.mapping.get.RestGetMappingAction
> 
> The trick is to issue a cluster state request
> 
> ```
> ClusterStateRequest clusterStateRequest = 
> 
> ```
> 
> Requests.clusterStateRequest()  
> .filterRoutingTable(true)  
> .filterNodes(true);
> 
> In the returned result, all indices and mappings can be filtered out.
> 
> Jörg

--  
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/d6b9d4a6-8052-42b2-95fd-0b8c46a84da7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6b9d4a6-8052-42b2-95fd-0b8c46a84da7%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:04am UTC](https://discuss.elastic.co/t/river-plugin-should-wait-until-a-specific-mapping-is-added-and-then-it-should-index-the-documents/14576/6 "2017-07-06T02:04:36Z")

</div>

Closed on July 6, 2017, 2:04am UTC


