Hi Jens,
No, but i didn’t know that either, so thank you.
What i’m trying is to do the following, All of this code below is in
aaf.rb (hopefully the formatting shows up in this email).
ActsAsFerret::define_index(‘site_index’,
:models => {
Product => {:fields => [:name, :company]},
Post => {:fields => [:title, :body]},
Prategory => {:fields => [:name]}
},
:ferret => {
:default_fields => [:name, :company, :title, :body, :name]
}
),
ActsAsFerret::define_index(‘forumindex’,
:models => {
Topics => {:fields => [:title]},
Messages => {:fields => [:title, :content]}
},
:ferret => {
:default_fields => [:title, :title, :content]
}
)
Now, i get errors when i try to do this, but essentially i want to
somehow use ‘site_Index’ to search those models across all of my site,
and only ‘forumindex’ when i put the search fields on the forum.
IN my Search_controller.rb file i have:
def search
per_page = 15
@results = ActsAsFerret.find(params[:q], ‘site_index’, {:page =>
params[:page], :per_page => per_page}, :conditions => [“account_id
= ?”, current_account.id] )
end
def forum
per_page = 30
@results = ActsAsFerret.find(params[:q], ‘forumindex’, {:page =>
params[:page], :per_page => per_page})
end
Notice that i have a condition statement for current_account’s on
site_index. Am i doing this wrong? Is there a better way to add
conditions that i’m unaware of?
I do love the benefits of a shared index, but i’m wondering if more
then on index can be written at a time?
thoughts?