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.

eZ debug

Timing: Jan 18 2025 02:55:42
Script start
Timing: Jan 18 2025 02:55:42
Module start 'content'
Timing: Jan 18 2025 02:55:42
Module end 'content'
Timing: Jan 18 2025 02:55:42
Script end

Main resources:

Total runtime0.2150 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.9844180.7578
Module start 'content' 0.00620.0254 768.742299.1484
Module end 'content' 0.03170.1832 867.8906530.1719
Script end 0.2149  1,398.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00381.7539200.0002
Check MTime0.00140.6638200.0001
Mysql Total
Database connection0.00070.323310.0007
Mysqli_queries0.114753.36751410.0008
Looping result0.00140.63391390.0000
Template Total0.182785.010.1827
Template load0.00110.520010.0011
Template processing0.181684.469410.1816
Override
Cache load0.00070.305510.0007
Sytem overhead
Fetch class attribute can translate value0.00080.374910.0008
XML
Image XML parsing0.00020.099510.0002
General
dbfile0.039618.4001200.0020
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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