Commit 7860f1a6 authored by Michael Rose's avatar Michael Rose

search: stop extracting data from _source

Postgres is authoritative
parent cb9a5b3b
......@@ -82,19 +82,19 @@ class SearchQuery
result['results'] = response['hits']['hits'].map do |hit|
s = hit['_source']
#h = Hashie::Rash.new(s)
h = s
h['updated'] = Time.iso8601(h['updated'] + "Z")
h['published'] = Time.iso8601(h['published'] + "Z")
h['last_seen'] = Time.iso8601(h['last_seen'] + "Z")
h['meta']['categories'] ||= []
h['meta']['characters'] ||= []
h['meta']['relationships'] ||= []
h['meta']['favs'] ||= 0
h['meta']['follows'] ||= 0
h['meta']['reviews'] ||= 0
h['story_id'] = h['story_id'].to_i
# h['updated'] = Time.iso8601(h['updated'] + "Z")
# h['published'] = Time.iso8601(h['published'] + "Z")
# h['last_seen'] = Time.iso8601(h['last_seen'] + "Z")
#
# h['meta']['categories'] ||= []
# h['meta']['characters'] ||= []
# h['meta']['relationships'] ||= []
# h['meta']['favs'] ||= 0
# h['meta']['follows'] ||= 0
# h['meta']['reviews'] ||= 0
h
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment