0
votes

I'd set default analyzer for index with this definition:

"index": {
    "analysis": {
      "analyzer": {
        "default": {
          "type": 'simple'
        }
      }
    }
  }

but then I getting settings of this index with query http://localhost:9200/test/_settings?pretty=true I getting only this, nothing about analyzer:

 {
  "test" : {
    "settings" : {
      "index" : {
        "creation_date" : "1423575850265",
        "uuid" : "Ac8QSGWbTtSCG7ib4VpV3Q",
        "number_of_replicas" : "1",
        "number_of_shards" : "5",
        "version" : {
          "created" : "1040299"
        }
      }
    }
  }
}
1

1 Answers

1
votes

Delete your index and try again. You definition should work. It is probable it didn't work because an index with the same name already existed.

Try the following code in your SENSE

DELETE test

POST test
{
    "index" : {
        "analysis" : {
            "analyzer" : {
                "default" : {
                    "type" : "simple"
                }
            }
        }
    }
}

GET test/_settings

This code returned:

{
   "test": {
      "settings": {
         "index": {
            "creation_date": "1423576958602",
            "uuid": "0iKpaL8uSKOSFT-oI1TJoQ",
            "analysis": {
               "analyzer": {
                  "default": {
                     "type": "simple"
                  }
               }
            },
            "number_of_replicas": "1",
            "number_of_shards": "5",
            "version": {
               "created": "1040199"
            }
         }
      }
   }
}

EDIT:

Problem was with single quotes around 'simple', all should key/values should be in double quotes – Maxim K.

The JSON syntax requires to use double quotes.