Skip to content

[#1103] Add missing match_phrase query #1104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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