Skip to content

Commit

Permalink
[#1103] Add missing match_phrase query
Browse files Browse the repository at this point in the history
Note:
- add auto_generate_synonyms_phrase_query option method
- add fuzzy_transpositions option method
  • Loading branch information
nsiregar committed Nov 20, 2020
1 parent acdbc09 commit 405ed76
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
16 changes: 9 additions & 7 deletions elasticsearch-dsl/lib/elasticsearch/dsl/search/queries/match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ class Match
include BaseComponent

option_method :query
option_method :operator
option_method :minimum_should_match
option_method :type
option_method :boost
option_method :analyzer
option_method :auto_generate_synonyms_phrase_query
option_method :fuzziness
option_method :prefix_length
option_method :max_expansions
option_method :prefix_length
option_method :fuzzy_transpositions
option_method :fuzzy_rewrite
option_method :analyzer
option_method :lenient
option_method :operator
option_method :minimum_should_match
option_method :zero_terms_query

option_method :type
option_method :boost
option_method :cutoff_frequency
option_method :max_expansions
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@
expect(search.to_hash[:match][:type]).to eq(10)
end
end

describe '#auto_generate_synonyms_phrase_query' do
it 'applies the option' do
search.auto_generate_synonyms_phrase_query 'false'

expect(search.to_hash[:match][:auto_generate_synonyms_phrase_query]).to eq('false')
end
end

describe '#fuzzy_transpositions' do
it 'applies the option' do
search.fuzzy_transpositions 'false'

expect(search.to_hash[:match][:fuzzy_transpositions]).to eq('false')
end
end
end

describe '#initialize' do
Expand Down

0 comments on commit 405ed76

Please sign in to comment.