Skip to content

Commit

Permalink
Merge pull request #73 from CDRH/date_bug
Browse files Browse the repository at this point in the history
fixes bug detecting date filters
  • Loading branch information
karindalziel authored Dec 11, 2017
2 parents d3b8ca1 + c170475 commit 1e9fb73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/search_item_req.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def facets
# histograms use a different ordering terminology than normal aggs
f_type = type == "_term" ? "_key" : "_count"

if f.include?("date") || f.include?("_d")
if f.include?("date") || f[/_d$/]
# NOTE: if nested fields will ever have dates we will
# need to refactor this to be available to both
if f.include?(".")
Expand Down Expand Up @@ -160,7 +160,7 @@ def filters
}
filter_list << nested
# DATE FIELD FILTER
elsif filter[0].include?("date") || filter[0].include?("_d")
elsif filter[0].include?("date") || filter[0][/_d$/]
# TODO rethink how all of the below is functioning, it is terrible

# NOTE: if nested fields contain date this will have to be changed
Expand Down

0 comments on commit 1e9fb73

Please sign in to comment.