Class: Workarea::Search::Storefront::Search

Inherits:
Workarea::Search::Storefront show all
Defined in:
app/models/workarea/search/storefront/search.rb

Instance Method Summary collapse

Methods inherited from Workarea::Search::Storefront

#active_segment_ids, #as_document, #cache, ensure_dynamic_mappings, ensure_product_mappings, #facets, #keywords, #numeric, #release_id, #sorts, #suggestion_content

Methods included from Elasticsearch::Document

all, #as_bulk_document, #as_document, current_index_prefix, #destroy, #initialize, #save

Instance Method Details

#activeObject



17
18
19
# File 'app/models/workarea/search/storefront/search.rb', line 17

def active
  { now: true }
end

#contentObject



9
10
11
# File 'app/models/workarea/search/storefront/search.rb', line 9

def content
  { name: model.query_string }
end

#idObject



5
6
7
# File 'app/models/workarea/search/storefront/search.rb', line 5

def id
  CGI.escape("#{type}-#{model.query_id}")
end

#slugObject



13
14
15
# File 'app/models/workarea/search/storefront/search.rb', line 13

def slug
  model.query_string.try(:parameterize)
end

#typeObject



21
22
23
# File 'app/models/workarea/search/storefront/search.rb', line 21

def type
  'search'
end