# ES - Create Index with jdbc, snowball analyer and mapping \[what is wrong with my query?\]

**URL:** <https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796>\
**Category:** Elasticsearch\
**Created:** [March 18, 2016, 7:09am UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796 "2016-03-18T07:09:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dom\_Sie](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@Dom\_Sie](https://discuss.elastic.co/u/Dom_Sie)\
**Post date:** [March 18, 2016, 7:09am UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796/1 "2016-03-18T07:09:30Z")

</div>

Hey 🙂

Please help me. I make this query to create an ES Index:

```
  curl -XPUT 'localhost:9200/_river/future_image/_meta' -d '{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "jdbc:mysql://localhost:3306/xxx",
        "user" : "xxxx",
        "password" : "xxx",
        "sql" : "select * from 0_fotos"
    },
		
 "settings": {
    "analysis" : {
			  "filter" : {
				 "germansnow" : {
					"language" : "German2",
					"type" : "snowball"
				 }
			  },
			  "analyzer" : {
				 "german" : {
					"filter" : [
					   "germansnow",
					   "icu_folding"
					],
					"type" : "custom",
					"tokenizer" : "icu_tokenizer"
				 },
				 "default" : {
					"sub_analyzers" : [
					   "standard",
					   "german"
					],
					"type" : "combo"
				 }
			  }
		   },
		   "mappings": {
			  "jdbc": {
				 "properties": {
					"create_date": {
					   "type": "date",
					   "format": "dd.MM.yyyy"
					}
				 }
			  }
		   } 
  }
}'

```

What is wrong with the syntax? There is no error when i am execute this query at bash; but my new index have no mapping for the field create\_date with the specific format and no analyzer :-/

Thx

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 18, 2016, 7:23am UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796/2 "2016-03-18T07:23:25Z")

</div>

Rivers have been removed. Don't use that.

Use the JDBC importer instead: [https://github.com/jprante/elasticsearch-jdbc](https://github.com/jprante/elasticsearch-jdbc)

Also, create your index first with the create index API: [https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-create-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-create-index.html)

---

<div class="post-metadata">

**Author:** ![Dom\_Sie](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@Dom\_Sie](https://discuss.elastic.co/u/Dom_Sie)\
**Post date:** [March 18, 2016, 8:01am UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796/3 "2016-03-18T08:01:09Z")

</div>

Hi,

thx for your fast answer.  
I must use rivers for this project because of strange reasons:/  
Okay; i am first create the index first with the create index api and then put the analyzers and mappings to the index?  
Is the syntax correct?

```
  curl -XPUT 'localhost:9200/_river/future_image/_meta' -d '{
     "settings": {
        "analysis" : {
    			  "filter" : {
    				 "germansnow" : {
    					"language" : "German2",
    					"type" : "snowball"
    				 }
    			  },
    			  "analyzer" : {
    				 "german" : {
    					"filter" : [
    					   "germansnow",
    					   "icu_folding"
    					],
    					"type" : "custom",
    					"tokenizer" : "icu_tokenizer"
    				 },
    				 "default" : {
    					"sub_analyzers" : [
    					   "standard",
    					   "german"
    					],
    					"type" : "combo"
    				 }
    			  }
    		   },
    		   "mappings": {
    			  "jdbc": {
    				 "properties": {
    					"create_date": {
    					   "type": "date",
    					   "format": "dd.MM.yyyy"
    					}
    				 }
    			  }
    		   } 
      }
    }'
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 18, 2016, 8:17am UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796/4 "2016-03-18T08:17:40Z")

</div>

No. You need to create settings for the target index which means the index where the river will send the data to.

---

<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:** [March 18, 2016, 8:32am UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796/5 "2016-03-18T08:32:19Z")

</div>

> [@Dom\_Sie](#):
>
> I must use rivers for this project because of strange reasons:/

Can you please elaborate? The details might be very important for all of us who have the challenge how to integrate external data importers with Elasticsearch, we want to develop the best of possible solutions.

The syntax is not correct, you can not create an index with `_river` endpoint. Beside that, there is no `_river` endpoint any more, unless you use very old Elasticsearch versions, which is not recommended (and not supported)

---

<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 5, 2017, 11:07pm UTC](https://discuss.elastic.co/t/es-create-index-with-jdbc-snowball-analyer-and-mapping-what-is-wrong-with-my-query/44796/6 "2017-07-05T23:07:15Z")

</div>


