Skip to content
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

Query DSL: Function score without function throws NPE #6292

Closed
clintongormley opened this issue May 23, 2014 · 2 comments
Closed

Query DSL: Function score without function throws NPE #6292

clintongormley opened this issue May 23, 2014 · 2 comments

Comments

@clintongormley
Copy link

PUT /t/test/1
{
  "text": "baseball bats"
}

GET /t/test/_search?explain
{
  "query": {
    "function_score": {
      "score_mode": "sum",
      "boost_mode": "replace",
      "functions": [
        {
          "filter": {
            "term": {
              "text": "baseball"
            }
          }
        }
      ]
    }
  }
}

Throws NPE. With a function (eg boost_factor) it doesn't:

GET /t/test/_search?explain
{
  "query": {
    "function_score": {
      "score_mode": "sum",
      "boost_mode": "replace",
      "functions": [
        {
          "filter": {
            "term": {
              "text": "baseball"
            }
          }
        },
        "boost_factor": 1
      ]
    }
  }
}
@s1monw
Copy link
Contributor

s1monw commented May 23, 2014

I guess we should throw a parse exception here no?

@s1monw
Copy link
Contributor

s1monw commented May 23, 2014

ah @brwe has is already assigned... I almost took it... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants