Forums / Extensions / eZ Find / updatesearchindexsolr for a siteaccess in an extension

updatesearchindexsolr for a siteaccess in an extension

Author Message

Mirko Battisti

Thursday 14 May 2009 2:39:02 am

Hello.

I have the following situation:
- one installation of ezpublish
- ezfind extension installed
- multiple websites, each one inside an extension (and the extension are indeed activated in the settings/override/site.ini file)

the structure is:


-ezpublish
 - ...
 - extension
   - website1
     - settings
       - siteacces
         - website1_admin
         - website1_it
   - website2
 - ...
 - settings
   - override
- ...

I want to update the search indexes for the siteaccess website1_admin. When I try:
php extension/ezfind/bin/php/updatesearchindexsolr.php -s website1_admin --php-exec=php5 --conc=2 --clean

It says "Siteaccess does not exist, using default siteaccess"

Therefore the siteaccess search indexes are never updated.
They are updated, though, when I add a new content via the ezpublish admin interface.

I tried to enable ezfind on a siteaccess basis ("ActiveAccessExtensions[]=ezfind" in extension/website1/settings/siteaccess/website1_it/site.ini.append.php) and on a larger scale ("ActiveExtensions[]=ezfind" settings/override/site.ini.append.php).

It's like it doesn't see the siteaccess that are located in an extension...
Now I wonder what I am doing wrong...
Anyone can shine a light on this?
Thank you!
Mirko.

Mirko Battisti

Thursday 14 May 2009 3:14:23 am

Update:

in the script updatesearchindexsolr.php, I've found the following lines (starting from line number 569):

protected function changeSiteAccessSetting( $siteaccess )
{
global $isQuiet;
$cli = eZCLI::instance();
if ( !file_exists( 'settings/siteaccess/' . $siteaccess ) )
{
if ( !$isQuiet )
$cli->notice( "Siteaccess $optionData does not exist, using default siteaccess" );
}
}

It tests if the siteaccess exists under the settngs/siteaccess/ folder.But my siteaccess is under the extension/ folder.

The extension (relative to my website) is activated, and everything but ezfind works properly.
I thought that at runtime, the 'settings' folders of the activated extensions were kind of joined together...am I wrong?
Is there a way to tell updatesearchindexsolr.php that it should look in the extension folder as well?

Where do I see how the update is called when a new content is added or a content is modified? Since that works, I should call the updatesearchindexsolr script in that same way.

Ideas?
Thanks,
Mirko.

Geoff Bentley

Wednesday 29 July 2009 4:35:15 pm

Hi Mirko,

Yes, this is a pain. One way around this is to add a symbolic link in settings/siteaccess/ to your extension siteaccess. I logged this as an issue last year - http://issues.ez.no/IssueView.php?Id=13850&activeItem=4

Hope this helps.

Mirko Battisti

Thursday 30 July 2009 6:18:05 am

Thanks, that's exactly how I got it solved.
Your post makes me think that I should have mentioned that here...
Thank you!
Mirko.