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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:20:18
Script start
Timing: Jan 18 2025 10:20:18
Module start 'layout'
Timing: Jan 18 2025 10:20:18
Module start 'content'
Timing: Jan 18 2025 10:20:18
Module end 'content'
Timing: Jan 18 2025 10:20:18
Script end

Main resources:

Total runtime0.0190 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 589.3203152.6563
Module start 'layout' 0.00780.0038 741.976639.5078
Module start 'content' 0.01160.0052 781.484494.5703
Module end 'content' 0.01680.0022 876.054734.3047
Script end 0.0190  910.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003015.7583140.0002
Check MTime0.00136.5869140.0001
Mysql Total
Database connection0.00126.263210.0012
Mysqli_queries0.003719.523530.0012
Looping result0.00000.079010.0000
Template Total0.00189.310.0018
Template load0.00105.484010.0010
Template processing0.00073.772710.0007
Override
Cache load0.00083.952110.0008
General
dbfile0.00052.459180.0001
String conversion0.00000.057740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs