Skip to content

Validate default similarity parameters strictly #29035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eskibars opened this issue Mar 13, 2018 · 2 comments
Closed

Validate default similarity parameters strictly #29035

eskibars opened this issue Mar 13, 2018 · 2 comments
Labels
>enhancement help wanted adoptme :Search/Search Search-related issues that do not fall into other categories

Comments

@eskibars
Copy link
Contributor

Elasticsearch version (bin/elasticsearch --version): 6.2.0

JVM version (java -version): 1.8

OS version (uname -a if on a Unix-like system): OSX

Description of the problem including expected versus actual behavior:

Steps to reproduce:

PUT test
{
  "settings": {
    "index" : {
        "similarity" : {
          "default" : {
            "type" : "bm25"
          }
        }
    }
  }
}

Produces the expected: "Unknown Similarity type [bm25] for [default]" since type needs to be BM25. However (at least for BM25 and classic), it's happy to accept/acknowledge arbitrary parameters that may not exist:

PUT test
{
  "settings": {
    "index" : {
        "similarity" : {
          "default" : {
            "type" : "BM25",
            "foo": "bar"
          }
        }
    }
  }
}

Validates even though there's obviously no foo parameter. I had a situation where I had a typo of k instead of k1 and I was thrown off for a little too long trying to figure out why my k value wasn't taking hold. It'd be great if we could strictly validate and error out as early as possible.

@eskibars eskibars added the :Data Management/Indices APIs APIs to create and manage indices and templates label Mar 13, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@colings86 colings86 added :Search/Search Search-related issues that do not fall into other categories and removed :Data Management/Indices APIs APIs to create and manage indices and templates labels Mar 14, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

jpountz added a commit to jpountz/elasticsearch that referenced this issue Mar 21, 2018
This improves the way similarities are plugged in in order to:
 - reject the classic similarity on 7.x indices and emit a deprecation
   warning otherwise
 - reject unkwown parameters on 7.x indices and emit a deprecation
   warning otherwise

Even though this breaks the plugin API, I'd like to backport to 7.x so
that users can get deprecation warnings when they are doing something
that will become unsupported in the future.

Closes elastic#23208
Closes elastic#29035
jpountz added a commit that referenced this issue Apr 3, 2018
This improves the way similarities are plugged in in order to:
 - reject the classic similarity on 7.x indices and emit a deprecation
   warning otherwise
 - reject unkwown parameters on 7.x indices and emit a deprecation
   warning otherwise

Even though this breaks the plugin API, I'd like to backport to 7.x so
that users can get deprecation warnings when they are doing something
that will become unsupported in the future.

Closes #23208
Closes #29035
jpountz added a commit to jpountz/elasticsearch that referenced this issue Apr 3, 2018
This improves the way similarities are plugged in in order to:
 - reject the classic similarity on 7.x indices and emit a deprecation
   warning otherwise
 - reject unkwown parameters on 7.x indices and emit a deprecation
   warning otherwise

Even though this breaks the plugin API, I'd like to backport to 7.x so
that users can get deprecation warnings when they are doing something
that will become unsupported in the future.

Closes elastic#23208
Closes elastic#29035
jpountz added a commit that referenced this issue Apr 4, 2018
This improves the way similarities are plugged in in order to:
 - reject the classic similarity on 7.x indices and emit a deprecation
   warning otherwise
 - reject unkwown parameters on 7.x indices and emit a deprecation
   warning otherwise

Even though this breaks the plugin API, I'd like to backport to 7.x so
that users can get deprecation warnings when they are doing something
that will become unsupported in the future.

Closes #23208
Closes #29035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement help wanted adoptme :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

4 participants