Elasticsearch Couchdb river Mapping problem

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
{

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

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/' -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 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 -d '{
"user" : {
"properties" : {
"first_name" : {
"type" : "string",
"search_analyzer" : "str_search_analyzer",
"index_analyzer" : "str_index_analyzer"
}
}'

See 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
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 14 févr. 2013 à 15:14, srilatha nallapati 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
{

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

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/' -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
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 -d '{
"user" : {
"properties" : {
"first_name" : {
"type" : "string",
"search_analyzer" : "str_search_analyzer",
"index_analyzer" : "str_index_analyzer"
}
}'

See
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
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 14 févr. 2013 à 15:14, srilatha nallapati <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
{

"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 <javascript:>.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.