sunspot-rails and solr auto-commit

345 views
Skip to first unread message

neon...@gmail.com

unread,
Jul 17, 2012, 12:01:59 PM7/17/12
to ruby-s...@googlegroups.com
A couple of days ago i've started experimenting with sunspot-rails after using ferret in other projects before.

I'm using a polymorphic Model with 2 associations that handle access rights and another one for dynamic fields.

And i'm having problems with getting index changes committed.
Even when i call Sunspot.commit after i saved my model instance the changes don't seem to get comitted.

When i repeat the update/save/commit a second time (after a short wait) they'll finally show up in the index.

For testing i've even tried to repeat my code 2 times to get it committed in one go but even that does not work.
I have to wait a while first. Which is completely strange.

I've then looked into setting autocommit in solrconfig.xml
    <autoCommit>
      <maxDocs>10000</maxDocs>
      <maxTime>60000</maxTime>
    </autoCommit>

But that doesn't seem to do anything either.
It almost seems like i now got to wait 60 seconds after an index change before it allows me to call Sunspot.commit on a rails console to finally get my changes live.

What is it that i'm doing wrong / not understanding?

I'm honsetly quite confused now. Please help.

neongrau

unread,
Jul 18, 2012, 8:51:21 AM7/18/12
to ruby-s...@googlegroups.com
nvm, looks like i called .save to early so it pretty much indexed the records with empty content. *facepalm*
Reply all
Reply to author
Forward
0 new messages