Unknown Similarity type [some.java.class] for [default] for a custom scoring class

Hi,
I created a java class which provides with a new scoring function:

public class NewScoreProvider extends AbstractSimilarityProvider {
    ...
}

This class is defined in package com.new.scoring.elasticsearch, so use it in the settings like

"index.similarity.default.type": "com.new.scoring.elasticsearch.NewScoreProvider"

But when I use this settings I get the following error:

{
   "error": {
      "root_cause": [
         {
            "type": "index_creation_exception",
            "reason": "failed to create index"
         }
      ],
      "type": "illegal_argument_exception",
      "reason": "Unknown Similarity type [com.new.scoring.elasticsearch.NewScoreProvider] for [default]"
   },
   "status": 400
}

I am using ES 2.1.1 and IntelliJ 15.

What could be the issue here?

Same problem here, and no solution. It worked for ES 1.7, but stopped working after I upgraded to ES 2.2.