从轮胎宝石的 DSL 示例中,给出了以下代码。
index = Tire.index('weather') do
delete
create
# First, a query named _warning_,
register_percolator_query('warning', :tags => ['warning']) { string 'warning OR severe OR extreme' }
# a query named _tsunami_,
register_percolator_query('tsunami', :tags => ['tsunami']) { string 'tsunami' }
end
matches = index.percolate(:message => '[Warning] Extreme flooding expected after tsunami wave.')
我想知道如何将匹配条件设置为一组术语而不是 ORed 字符串。
例如string 'warning weather OR severe weather OR extreme weather'
将匹配warning
或weather
不同时匹配warning weather
。