-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Elasticsearch version: 2.3
JVM version: 1.8.0_66
OS version: linux 3.2.0-106-generic-pae
Description of the problem including expected versus actual behavior:
The documentation says that date units expressions work for 'scale' parameter of the decay function, however not all date time units seem work.
As the user I expect an expression as '10y' or '10Y' work as '10 years'
Also I expect an expression as '2M' work as '2 month'.
Actually years pattern isn't supported and 'M' unit works as minutes.
There is a work-around to write '365d' instead of year and '30d' instead of month, however it will produce slightly different results if the current month has 31, 28 or 29 days or the current year is leap.
If years and months units can't be supported the documentation should have a complete list of supported units (now it isn't obvious)
Steps to reproduce:
- Create a mapping with the indexed date field
- Put some documents
- Perform the fuctional score query with any decay function on your date field and scale with year or month expression
Logs:
Caused by: ElasticsearchParseException[Failed to parse setting [GaussDecayFunctionParser.scale] with value [10y] as a time value: unit is missing or unrecognized]
(see the attachment for stack trace)
log.txt