You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.
Hi,
I have a 'Tweet' model which belongs to a 'Profile' model.
Tweet(:title, :text, :profile_id)
Profile(:name, :visits)
I need to search for tweets which has a profile with specific name such as 'xxx'
The following is my code which does not work:
mapping do
indexes :id, index: :not_analyzed
indexes :profile_id, index: :not_analyzed
indexes :title, analyzer: 'snowball', boost: 100
indexes :text, analyzer: 'snowball'
indexes :created_at, type: 'date', index: :not_analyzed
indexes :profile do
indexes :id, index: :not_analyzed
indexes :name, analyzer: 'snowball'
end
end
def self.search (q, page)
tire.search(load: true, :per_page => 10, :page => page) do
query { string (q + "*"), default_operator: "AND" } if q.present?
filter :range, created_at: {lte: Time.zone.now}
# filter :terms, :profile_id => [1,2,3], :execution => 'or' ### this works!
# filter :terms, 'profile.name' => ['Payam','Navid'] ### this does not work!
end
end
Please help me. Thank you in advance.
The text was updated successfully, but these errors were encountered: