This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Lucene doesn't (re)index on object save

Questions relating to sfLucenePlugin, sfSearch etc

Lucene doesn't (re)index on object save

by Junni » Tue Jun 01, 2010 11:14 pm

Hi all,

I have installed and configured the sfLucenePlugin. Indexing through terminal works just fine, and the search page delivers results with categories. So far, so good!

When I change some indexed fields from an object and save the changes, the saveIndex() is not called. When I override the save() method and call the Lucene saveIndex() manually, an error is thrown with the message that the method is unknown. It seems the Propel behavior is not active.

I've added the behavior, as mentioned in the readme of the plugin:

Code: Select all
sfLucenePropelBehavior::getInitializer()->setup('Content');


Anyone with an idea or suggestion?

Maybe important: I'm using Propel15Plugin.
Junni
Member
 
Posts: 96
Joined: Wed Jan 17, 2007 3:52 am
Location: Belgium

Re: Lucene doesn't (re)index on object save

by Junni » Tue Jun 01, 2010 11:37 pm

Rookie mistake! I thought propel behaviors were enabled with the following line:

Code: Select all
propel.behavior.symfony_behaviors.class        = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors


But I also had to enable the addBehaviors:

Code: Select all
propel.builder.addBehaviors = true


Problem solved!
Junni
Member
 
Posts: 96
Joined: Wed Jan 17, 2007 3:52 am
Location: Belgium