# Elasticsearch Couchdb river Mapping problem

**URL:** <https://discuss.elastic.co/t/elasticsearch-couchdb-river-mapping-problem/10747>\
**Category:** Elasticsearch\
**Created:** [February 14, 2013, 2:14pm UTC](https://discuss.elastic.co/t/elasticsearch-couchdb-river-mapping-problem/10747 "2013-02-14T14:14:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![srilatha\_nallapati](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@srilatha\_nallapati](https://discuss.elastic.co/u/srilatha_nallapati)\
**Post date:** [February 14, 2013, 2:14pm UTC](https://discuss.elastic.co/t/elasticsearch-couchdb-river-mapping-problem/10747/1 "2013-02-14T14:14:01Z")

</div>

I have the Elastisearch couchdb river installed. I am looking to creating  
mappings for my database. I have different types of documents in my couchdb  
database. I want to specify an individual mapping for each type of  
document.

I tried this way and is throwing an error.

PUT [http://localhost:9200/\_river/user/\_mapping](http://localhost:9200/_river/user/_mapping)  
{

```
"user" : {
  "properties" : {
    "first_name" : {
      "type" : "string",
      "search_analyzer" : "str_search_analyzer",
      "index_analyzer" : "str_index_analyzer"
    }
  }
  ,

```

"settings" : {  
"analysis" : {  
"analyzer" : {  
"str\_search\_analyzer" : {  
"tokenizer" : "keyword",  
"filter" : ["lowercase"]  
},

```
    "str_index_analyzer" : {
      "tokenizer" : "keyword",
      "filter" : ["lowercase", "substring"]
    }
  },

  "filter" : {
    "substring" : {
      "type" : "edgeNGram",
      "min_gram" : 2,
      "max_gram" : 20
    }
  }
}

```

}  
}  
}

ERROR:  
{"error":"MapperParsingException[Analyzer [str\_search\_analyzer] not found  
for field [first\_name]]","status":400}

Can any one help me how this can be rectified or any such kind of JSON  
examples?

Also, I need to give mapping for few more fields like "last\_name",  
"organization" etc. How I can specify multiple fields in the above  
example?

Thanks,  
Srilatha

--  
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:** ![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:** [February 14, 2013, 2:26pm UTC](https://discuss.elastic.co/t/elasticsearch-couchdb-river-mapping-problem/10747/2 "2013-02-14T14:26:05Z")

</div>

Hey,

1st:  
Create your analyzer when you create your index: Something like the following (I did not check the exact syntax):  
$ curl -XPUT '[http://localhost:9200/whateveryourindexis/](http://localhost:9200/whateveryourindexis/)' -d '{  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"str\_search\_analyzer" : {  
"tokenizer" : "keyword",  
"filter" : ["lowercase"]  
},

```
    "str_index_analyzer" : {
      "tokenizer" : "keyword",
      "filter" : ["lowercase", "substring"]
    }
  },

  "filter" : {
    "substring" : {
      "type" : "edgeNGram",
      "min_gram" : 2,
      "max_gram" : 20
    }
  }
}

}

```

}'

See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html) for details

2nd: you want to define a mapping for your type user under index "whateveryourindexis".  
Don't send a mapping to the special index \_river

Send something like:  
$ curl -XPUT [http://localhost:9200/whateveryourindexis/user/\_mapping](http://localhost:9200/whateveryourindexis/user/_mapping) -d '{  
"user" : {  
"properties" : {  
"first\_name" : {  
"type" : "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer"  
}  
}'

See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html) for details

Then, you can create the river.

Does it help?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 14 févr. 2013 à 15:14, srilatha nallapati [srilathakln@gmail.com](mailto:srilathakln@gmail.com) a écrit :

> I have the Elastisearch couchdb river installed. I am looking to creating mappings for my database. I have different types of documents in my couchdb database. I want to specify an individual mapping for each type of document.
> 
> I tried this way and is throwing an error.
> 
> PUT [http://localhost:9200/\_river/user/\_mapping](http://localhost:9200/_river/user/_mapping)  
> {
> 
> ```
> "user" : {
> "properties" : {
> "first_name" : {
> "type" : "string",
> "search_analyzer" : "str_search_analyzer",
> "index_analyzer" : "str_index_analyzer"
> }
> }
> ,
> 
> ```
> 
> "settings" : {  
> "analysis" : {  
> "analyzer" : {  
> "str\_search\_analyzer" : {  
> "tokenizer" : "keyword",  
> "filter" : ["lowercase"]  
> },
> 
> ```
> "str_index_analyzer" : {
> "tokenizer" : "keyword",
> "filter" : ["lowercase", "substring"]
> }
> },
> 
> "filter" : {
> "substring" : {
> "type" : "edgeNGram",
> "min_gram" : 2,
> "max_gram" : 20
> }
> }
> }
> 
> ```
> 
> }  
> }  
> }
> 
> ERROR:  
> {"error":"MapperParsingException[Analyzer [str\_search\_analyzer] not found for field [first\_name]]","status":400}
> 
> Can any one help me how this can be rectified or any such kind of JSON examples?
> 
> Also, I need to give mapping for few more fields like "last\_name", "organization" etc. How I can specify multiple fields in the above example?
> 
> Thanks,  
> Srilatha
> 
> --  
> 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).

--  
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:** ![srilatha\_nallapati](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@srilatha\_nallapati](https://discuss.elastic.co/u/srilatha_nallapati)\
**Post date:** [February 15, 2013, 2:35pm UTC](https://discuss.elastic.co/t/elasticsearch-couchdb-river-mapping-problem/10747/3 "2013-02-15T14:35:12Z")

</div>

Hi David,

I created analyzer, mapping and then river. It is working fine now.

Thank you very much for your help.

On Thursday, February 14, 2013 7:56:05 PM UTC+5:30, David Pilato wrote:

> Hey,
> 
> 1st:  
> Create your analyzer when you create your index: Something like the  
> following (I did not check the exact syntax):  
> $ curl -XPUT '[http://localhost:9200/whateveryourindexis/](http://localhost:9200/whateveryourindexis/)' -d '{  
> "settings" : {  
> "analysis" : {  
> "analyzer" : {  
> "str\_search\_analyzer" : {  
> "tokenizer" : "keyword",  
> "filter" : ["lowercase"]  
> },
> 
> ```
> "str_index_analyzer" : {
> "tokenizer" : "keyword",
> "filter" : ["lowercase", "substring"]
> }
> },
> 
> "filter" : {
> "substring" : {
> "type" : "edgeNGram",
> "min_gram" : 2,
> "max_gram" : 20
> }
> }
> }
> 
> }
> 
> ```
> 
> }'
> 
> See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html) for  
> details
> 
> 2nd: you want to define a mapping for your type user under index  
> "whateveryourindexis".  
> Don't send a mapping to the special index \_river
> 
> Send something like:  
> $ curl -XPUT [http://localhost:9200/whateveryourindexis/user/\_mapping](http://localhost:9200/whateveryourindexis/user/_mapping) -d '{  
> "user" : {  
> "properties" : {  
> "first\_name" : {  
> "type" : "string",  
> "search\_analyzer" : "str\_search\_analyzer",  
> "index\_analyzer" : "str\_index\_analyzer"  
> }  
> }'
> 
> See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html) for  
> details
> 
> Then, you can create the river.
> 
> Does it help?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 14 févr. 2013 à 15:14, srilatha nallapati \<[srila...@gmail.com](mailto:srila...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> I have the Elastisearch couchdb river installed. I am looking to creating  
> mappings for my database. I have different types of documents in my couchdb  
> database. I want to specify an individual mapping for each type of  
> document.
> 
> I tried this way and is throwing an error.
> 
> PUT [http://localhost:9200/\_river/user/\_mapping](http://localhost:9200/_river/user/_mapping)  
> {
> 
> ```
> "user" : {
> "properties" : {
> "first_name" : {
> "type" : "string",
> "search_analyzer" : "str_search_analyzer",
> "index_analyzer" : "str_index_analyzer"
> }
> }
> ,
> 
> ```
> 
> "settings" : {  
> "analysis" : {  
> "analyzer" : {  
> "str\_search\_analyzer" : {  
> "tokenizer" : "keyword",  
> "filter" : ["lowercase"]  
> },
> 
> ```
> "str_index_analyzer" : {
> "tokenizer" : "keyword",
> "filter" : ["lowercase", "substring"]
> }
> },
> 
> "filter" : {
> "substring" : {
> "type" : "edgeNGram",
> "min_gram" : 2,
> "max_gram" : 20
> }
> }
> }
> 
> ```
> 
> }  
> }  
> }
> 
> ERROR:  
> {"error":"MapperParsingException[Analyzer [str\_search\_analyzer] not found  
> for field [first\_name]]","status":400}
> 
> Can any one help me how this can be rectified or any such kind of JSON  
> examples?
> 
> Also, I need to give mapping for few more fields like "last\_name",  
> "organization" etc. How I can specify multiple fields in the above  
> example?
> 
> Thanks,  
> Srilatha
> 
> --  
> 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](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:** ![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:51am UTC](https://discuss.elastic.co/t/elasticsearch-couchdb-river-mapping-problem/10747/4 "2017-07-06T02:51:20Z")

</div>


