2013-07-15 185 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

回答