From b315d48432416e9cf9f9c150912fb77592f67ed0 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 10 Mar 2019 19:06:01 +0100 Subject: [PATCH] provide fallback index field for malformed dates. #215 --- app/models/doi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index 4b8f965c3..ca944bd0b 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -178,7 +178,7 @@ class Doi < ActiveRecord::Base awardTitle: { type: :keyword } } indexes :dates, type: :object, properties: { - date: { type: :date, format: "yyyy-MM-dd||yyyy-MM||yyyy", ignore_malformed: true }, + date: { type: :date, format: "date_optional_time", ignore_malformed: true, fields: { raw: { type: :text }} }, dateType: { type: :keyword } } indexes :geo_locations, type: :object, properties: {