1

Using Elasticsearch 1.4.4, I have this script -

doc[field].date.getMinuteOfDay() >= gte && doc[field].date.getMinuteOfDay() <= lte

Stored here - config/script/minuteOfDayRange.groovy

I run this query:

POST test_index/_search
{
  "filter": {
    "script": {
      "script_file": "minuteOfDayRange",
      "params": {
        "field": "start_time",
        "gte": 0,
        "lte": 1439
      }
    }
  },
  "size": 0
}

and get an error. Here is part of the error (it's really big so I tried to show only the parts that looked the most helpful):

"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed;......nested: QueryParsingException[[test_index] [script] filter does not support [script_file]];......

It sounds like this part of the error with [script] filter does not support [script_file] is saying script filters don't work with script_file. Is that correct? I've used script_file to generate terms with success on this same index. Previous to updating to 1.4.4 this same filter worked using dynamic scripts, but I am now using the script_file method since updating to 1.4.4. Is it possible for me to use a script filter in a file, and if so, how?

1 Answer 1

1

It worked by changing script_file to just script in the query.

I found a similar issue on github that was a clue to try this: https://github.com/elastic/elasticsearch/issues/10007

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.