app/models/concerns/indexable.rb
# don't raise an exception when not found
don't raise an exception when not found
don ' t raise an exception when not found
def query(query, options = {})
      __elasticsearch__.search({
                                 from: options[:from],
                                 size: options[:size],
                                 sort: [options[:sort]],
                                 query: {
                                   bool: {
                                     must: {
                                       query_string: {
                                         query: "#{query}*",
                                         fields: query_fields,
                                       },
                                     },
                                     filter: query_filter(options),
                                   },
                                 },
                                 aggregations: query_aggregations,
                               })
    end
def query ( query , options = { } ) __elasticsearch__ . search ( { from : options [ :from ] , size : options [ :size ] , sort : [ options [ :sort ] ] , query : { bool : { must : { query_string : { query : "#{query}*" , fields : query_fields , } , } , filter : query_filter ( options ) , } , } , aggregations : query_aggregations , } ) end
don't raise an exception when not found
don ' t raise an exception when not found
query
<not_specific>
options
<not_specific>