Hi Alex!
On Thu, Aug 10, 2006 at 09:55:11PM +0200, Alex Dean
wrote:> Hi,
>
> I''m having some problems with acts_as_ferret and indexing.
I''ve got a
> simple 5 column table, and a corresponding Ruby model. I loaded 9 rows
> directly into the table using mysql (for live it''ll be about .5mil
rows)
> and configured a Rails search page along the exact same lines as
> ferret_demo.
>
> Unfortunately, search wouldn''t return any results; following the
advice
> given to other posters, I deleted the index/development/[ModelName]
> folder. I expected then for the index to automatically get rebuilt, but
> unfortunately any search then resulted in:
the index should be rebuilt if you stop your application, delete the
folder as you did, and then start the app again. If that doesn''t work,
please try upgrading to the latest version (0.2.2) of the plugin.
> : Error occured at <fs_store.c>:318
> Error: exception 2 not handled: Couldn''t open the file to read
>
> vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:284:in
`search''
> vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:284:in
> `find_id_by_contents''
> vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:246:in
> `find_by_contents''
> #{RAILS_ROOT}/app/controllers/search_controller.rb:55:in `search''
>
> I noticed that the index/development/[ModelName] folder was being
> recreated, but empty.
>
> Luckily I managed to get the rebuild_index.rb script working, which
> recreated the index folder structure, and then added a couple of files:
> _a.cfs and segments
>
> I can now search without error, but I don''t get any search results
for
> the original 9 rows in the table. I can add rows, and these extra rows
> seem to cause activity in index/development/[ModelName] folder, and they
> get picked up by search.
>
> But the fundamental problem remains, that I can''t get Ferret to
search
> and return the original 9 rows.
hm, are you sure these 9 rows look the same as those created by your
later inserts ? Does loading/saving them in Rails cause them to get
indexed ? Have a look at your development log too see what happens when
doing so, acts_as_ferret logs quite exactly what it is doing.
hth,
Jens
--
webit! Gesellschaft f?r neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de
Schnorrstra?e 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66