Skip to content

Commit

Permalink
add slop to multi_match query. #123
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 23, 2018
1 parent e8ccc58 commit 4cd652d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def query(query, options={})
end

must = []
must << { multi_match: { query: query, fields: query_fields, type: "phrase_prefix", max_expansions: 50 }} if query.present?
must << { multi_match: { query: query, fields: query_fields, type: "phrase_prefix", slop: 3, max_expansions: 10 }} if query.present?
must << { term: { aasm_state: options[:state] }} if options[:state].present?
must << { term: { resource_type_id: options[:resource_type_id] }} if options[:resource_type_id].present?
must << { terms: { provider_id: options[:provider_id].split(",") }} if options[:provider_id].present?
Expand Down

0 comments on commit 4cd652d

Please sign in to comment.