still banging my head against this. at a suggestion from jens i checked the
index size with irb, and it is indeed larger than it should be -- extra entries
are being put in. i also got the demo from svn and ran the unit tests, some of
which failed. the failing tests look like they're related to multiple id
issues, too -- i'll paste them in below.

i'm slowly working my way through the code, but ferret is new to me (ruby too,
really), so it might take a while. if anyone has any pointers in the meanwhile,
i'd really appreciate it. since my problems have been so consistent, and since i
get similar issues with the demo, i'm guessing it might have something to do
with changes to ActiveRecord in Rails 1.1.

fwiw, my env details again: mac os 10.4.6, mysql 5.0.18, ruby 1.8.4, rails 1.1,
ferret 0.9, acts_as_ferret from trunk. i removed all other plugins from my app
in case they were conflicting, and still had the same problems.

here's the rake output from the unit tests:


dewey:~/user/squirl/aaf_demo/aaf_demo john$ rake
(in /Users/john/user/squirl/aaf_demo/aaf_demo)
/opt/local/bin/ruby -Ilib:test
"/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader.rb"
"test/unit/comment_test.rb" "test/unit/content_test.rb"
Loaded suite
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader
Started
........FFF.F.
Finished in 22.529063 seconds.

  1) Failure:
test_id_multi_search(ContentTest) [./test/unit/content_test.rb:96]:
<5> expected but was
<6>.

  2) Failure:
test_indexed_method(ContentTest) [./test/unit/content_test.rb:43]:
<1> expected but was
<0>.

  3) Failure:
test_multi_index(ContentTest) [./test/unit/content_test.rb:67]:
<5> expected but was
<6>.

  4) Failure:
test_multi_search(ContentTest) [./test/unit/content_test.rb:85]:
<5> expected but was
<6>.

14 tests, 70 assertions, 4 failures, 0 errors
/opt/local/bin/ruby -Ilib:test
"/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader.rb"
"test/functional/content_controller_test.rb"
Loaded suite
/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader
Started
.........
Finished in 3.15368 seconds.

9 tests, 36 assertions, 0 failures, 0 errors
rake aborted!
Test failures






Quoting John McGrath <[EMAIL PROTECTED]>:

> hi jens, updated to trunk, but still having the same issue
>
> in my Book.rb model i have the acts_as_ferret line with no attributes:
> acts_as_ferret. to keep things simple it's the only model using
> acts_as_ferret
> right now.
>
> my controller code is based on the example in the comments above
> find_id_by_contents:
>
> @res << Book.find_id_by_contents(params[:search][:search_term])
>
> if i zero both the index and the db, then add a single book, one (and only
> one)
> book appears in the 'books' table, but the line above from the controller
> returns 3 results from the newly-created index at index/development/Book.
>
> it's coming from somewhere in the plugin, i think, because when i add this
> line
> to find_id_by_contents, right after the call to ferret_index.search(q,
> option):
> logger.debug("hits is: #{hits.size}")
>
> this shows up in the log:
> hits is: 3
>
> best,
> john
>
>
> Quoting Jens Kraemer <[EMAIL PROTECTED]>:
>
> > Hi John,
> >
> > On Wed, Apr 05, 2006 at 12:09:37AM -0400, John McGrath wrote:
> > > i'm using Ferret 0.9.0 with acts_as_ferret (the one from
> svn.jkraemer.net),
> > and
> > > i'm getting duplicate results, as described in this thread:
> > > http://rubyforge.org/pipermail/ferret-talk/2005-December/000048.html
> > >
> > > is there a way to configure the indexes created by acts_as_ferret to use
> > :key =>
> > > :id, as described in that thread? i've poked around in the code, and had
> > trouble
> > > even finding where the index was being created.
> >
> > acts_as_ferret uses the id as a key by default. Could you please check
> > if this problem still occurs with the current trunk (located at
> > svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret )
> >
> >
> > Cheers,
> > Jens
> >
> >
> > --
> > webit! Gesellschaft für neue Medien mbH          www.webit.de
> > Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
> > Schnorrstraße 76                         Tel +49 351 46766  0
> > D-01069 Dresden                          Fax +49 351 46766 66
> > _______________________________________________
> > Ferret-talk mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/ferret-talk

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to