Sha256: 6ec877ef6b7dd7446ec1f5ea9fa91e5b93ef1da2fb6d7b34ea945c2a31559afc
Contents?: true
Size: 809 Bytes
Versions: 34
Compression:
Stored size: 809 Bytes
Contents
module Workarea module Search class SearchSuggestions include Query document Search::Storefront def results response['hits']['hits'] end def sanitized_string @sanitized_query ||= QueryString.new(params[:q]).sanitized end def query { bool: { must: [ { match_phrase_prefix: { 'content.name': { query: sanitized_string, max_expansions: 10 } } }, { term: { 'active.now' => true } } ] } } end def sort { type: :desc } end def size Workarea.config.search_suggestions end end end end
Version data entries
34 entries across 34 versions & 1 rubygems