mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 17:06:31 -06:00
651476e89e
If a post contains domain with a word that stems to a non prefix single words will not match it. For example: in happy.com, `happy` stems to `happi`. Thus searches for happy will not find URLs with it included. This bloats the index a tiny bit, but impact is limited. Will require a full reindex of search to take effect. When we are done refining search we can consider a full version bump.
22 lines
640 B
Ruby
22 lines
640 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec::Matchers.define :eq_ts_vector do |expected_vector|
|
|
match do |actual_vector|
|
|
actual = actual_vector.split(" ").sort
|
|
expected = expected_vector.split(" ").sort
|
|
|
|
(expected - actual == []) && (actual - expected == [])
|
|
end
|
|
failure_message do |actual_vector|
|
|
actual = actual_vector.split(" ").sort
|
|
expected = expected_vector.split(" ").sort
|
|
|
|
message = +"ts_vector does not match!\n\n"
|
|
message << "Additional elements:\n"
|
|
message << (expected - actual).join("\n")
|
|
message << "\nMissing elements:\n"
|
|
message << (actual - expected).join("\n")
|
|
message
|
|
end
|
|
end
|