2013-07-15 227 views
0

tire gem's DSL example給出以下代碼。ElasticSearch通過集合過濾

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'將匹配warningweather而不是兩個warning weather在一起。

+0

找到你的解決方案了嗎?看到我的答案?你怎麼修好它的? – Benj

回答