Sorry in advance for the newbie question. Can't get aaf going and can't
find similarly stuck folks on this forum.

I'm running Rails on my local machine in development mode. I installed
ferret 0.11.0 gem, and the most recent stable aaf plugin (as of today).

I'm having trouble getting the most basic functionality working. In my
model Recipe, I have:

  acts_as_ferret  :fields => [:handle, :introduction, :ingredients,
:steps],
                  :single_index => true

In my search controller, I have:

@results = Recipe.find_by_contents(params[:search_query])

If the index doesn't exist yet, then the above will do the following:

1. throw the following error:

RuntimeError (tried to use a closed index):
    /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.0/lib/ferret/index.rb:695:in
`ensure_searcher_open'

2. write the following log entries:

rebuild index: []
reindexing model Recipe
reindex model Recipe : 0.00% complete : 2.08 secs to finish
Created Ferret index in: script/../config/../index/development/shared
rebuild index: []
reindexing model Recipe
reindex model Recipe : 0.00% complete : 1.86 secs to finish
Created Ferret index in: script/../config/../index/development/shared
rebuild index: []
reindexing model Recipe
reindex model Recipe : 0.00% complete : 1.96 secs to finish
Created Ferret index in: script/../config/../index/development/shared
query: +(id:test class_name:test introduction:test ingredients:test
handle:test steps:test) +class_name:Recipe
stored_fields:

Apparently, aaf is indexing the recipes table not once, not twice, but
three separate times. Still, a proper index does seem to be created (ie.
I crack open the generated "_11.cfs" file and sure enough, it has pieces
of words from the recipes table).

Yet even though it seems the index is being (inefficiently?) generated,
find_by_contents fails because it thinks the index is closed.

Anybody have a clue on where I might look for an answer to this problem?

Thanks

Peter

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to