sudha
sudha

Reputation: 1

unable to update index in elassandra

I am very new to elassandra and facing an issue while trying to update an index that i created before. I initially created the index as below

    curl -XPUT 'http://xxx.xx.xx.xxx:xxxx/yesanoa?pretty' -H 'Content-Type:   
    application/json' -d'
    {
    "settings": {
    "index.mapping.ignore_malformed": true,
    "analysis": {
    "normalizer": {
    "yesanoa_norm": {
      "type": "custom",
      "char_filter": [],
      "filter": ["lowercase", "asciifolding"]
      }
      }
      }
      },
      "mappings": {
      "movies": {"discover" : ".*","properties" : {"title" : {
                 "type" : "text", "normalizer": "yesanoa_norm", "index" : 
      "analyzed"},"site_review" : {
                 "type" : "text", "normalizer": "yesanoa_norm", "index" : 
      "analyzed"}}}}}'

And I'm trying to update this as below,

    curl -XPUT 'http://xxx.xx.xx.xxx:xxxx/yesanoa/genre' -d'{
    "mappings": {
    "genre": {"discover" : ".*","properties" : {"title" : {
                 "type" : "text", "normalizer": "yesanoa_norm", "index" : 
    "analyzed"}}}}}'

I'm getting the following error

"No handler found for uri [/yesanoa/genre] and method [PUT][root@dbcasyn elassandra-5.5.0.4]"

I tried rebuilding the index using nodetool option. But nothing worked.

Please help me guys on this.

Upvotes: 0

Views: 245

Answers (1)

barth
barth

Reputation: 441

When you have an existing index and want to add a new type (until Elaticsearch/Elassandra v5), you use the following syntax :

PUT anIndex/_mapping/aType
{
  "properties": {
     "aProperty": {
        "type": "text"
      }
   }
 }

See the elasticsearch Put Mapping documentation

EDIT: By the way, the mapping update does not support the discovery option. You have do it explicitly.

Upvotes: 1

Related Questions