Following the nobrainer docs here: http://nobrainer.io/docs/querying/
I am trying to do an OR query, to look for articles where a keyword matches the title or text fields...
The following query returns no results...
s = 'something'
@articles = Article.where(:or=>[:title=>/(?i)#{s}/, :text=>/(?i)#{s}/])
I checked my regex with the following query and it works...
@articles = Article.where(:title=>/(?i)#{s}/)
Could someone help us understand how to do OR queries? Thanks.
UPDATE:
The query returns results only if the search term is found in both fields... so it appears to be working like an AND instead of an OR!