Forums / Developer / Update Solr Index after object import ?

Update Solr Index after object import ?

Author Message

H-Works Agency

Tuesday 21 September 2010 4:15:06 am

Hello everyone,

I have a php script which import contents objects.

My front website uses ezfind to fetch every contents but imported contents doesn't shows up even after running all possibles ezfind cronjobs and scripts :

- php runcronjobs -s mysite (ezfindexcontent|ezfoptimizeindex)

- php extension/ezfind/bin/php/updatesearchindexsolr.php -s

- php extension/ezfind/bin/php/ezsolroptimize.php -s

Is there something special to do ?

What is strange is that contents get indexed if i republish the object via admin siteaccess...

Any help would be appreciated !

EZP is Great

Matthieu Sévère

Tuesday 21 September 2010 4:32:50 am

Hi Martin,

Do you get any errors in var/log/error.log ?

Do you run the script php extension/ezfind/bin/php/updatesearchindexsolr.php with your admin siteaccess ?

--
eZ certified developer: http://ez.no/certification/verify/346216

H-Works Agency

Tuesday 21 September 2010 5:10:44 am

Hello,

In fact i have this : [ Sep 21 2010 11:07:51 ] [83.199.84.18] eZSolr::addObject():1502 Unable to fetch main node for object: 588

Gonna correct my import script - thanx !

EZP is Great

Matthieu Sévère

Tuesday 21 September 2010 5:16:45 am

I you're dealing with import you may consider this awesome extension : http://projects.ez.no/sqliimport

Cheers

--
eZ certified developer: http://ez.no/certification/verify/346216

H-Works Agency

Tuesday 21 September 2010 8:52:08 am

Still can't find them using ezfind. damned.

Do i have to use the registerSearchObject method after importing something ?

Is it ok to use "createAndPublishObject" method in 4.2 copied from 4.3 ?

Please help :(((

Thanx

EZP is Great

Carlos Revillo

Tuesday 21 September 2010 12:49:21 pm

Hi Martin.

Recently i have into the same issue. not usign createAndPublishObject though, but that shouldn' t be the problem.

in my case, the problem was that my content objects has some ezdate attributes, but i was not filling those attribs with any value. so, i was sending empty values to solr for those attrs and solr failed indexing those objects...

could this be the case?

the issue is reported and fixed by Paul at http://issues.ez.no/IssueView.php?Id=16365&activeItem=6

hope it helps.

H-Works Agency

Wednesday 22 September 2010 3:53:01 am

Hello Carlos,

Thank you for the tip it can be the case here as my content class has multiple ezdate attributes and they are not mandatory. I am gonna try to fill those in to see what happens.

What i don't understand with ezfind is that it doesn't seems necessary to run indexation cronjobs, in fact when i publish content via the admin siteaccess objects are indexed even without cronjobs.

Does anybody know what those cronjobs are made for ?

EZP is Great

H-Works Agency

Wednesday 22 September 2010 10:01:51 am

You were right carlos thanx a lot !

After filling every date field ezfind indexes contents.

I hope this will be corrected because its a real problem though.

EZP is Great

Sebastiaan van der Vliet

Wednesday 22 September 2010 11:30:18 am

Some other datatypes might give you the same problem. In the function addDocs in eZ find, ezsolrbase.php, check the string $updateResult. Solr will tell you there what the problem is.

As a solution, instead of filling al the date fields, you can also change the configuration in schema.xml, turning the date field into a text field within the dynamic field definitions, e.g:

<field name="exm_dateemploy_dt" type="text" indexed="true" stored="true" multiValued="true"/>

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

H-Works Agency

Tuesday 05 October 2010 10:28:45 am

Hi,

Thanx a lot for this. I am running into multiple problems trying to run ezfind in production sites....usually small details making everything fall apart.

After content import i have a lot of warning and content indexation problems :

   
Undefined offset: 36760 in /$home/ezpublish-4.3.0_dev/extension/ezfind/search/plugins/ezsolr/ezsolr.php on line 814
Notice: PHP: E_NOTICE Oct 05 2010 19:26:02
Undefined property: eZContentObject::$ClassID in /$home/ezpublish-4.3.0_dev/kernel/classes/ezpersistentobject.php on line 1224

Ending with hundreds of warning in my debug.

EZP is Great

eZ debug

Timing: Jan 29 2025 13:29:40
Script start
Timing: Jan 29 2025 13:29:40
Module start 'content'
Timing: Jan 29 2025 13:29:40
Module end 'content'
Timing: Jan 29 2025 13:29:41
Script end

Main resources:

Total runtime0.1152 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9531180.8281
Module start 'content' 0.00520.0057 768.7813106.7109
Module end 'content' 0.01090.1043 875.4922534.3281
Script end 0.1152  1,409.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00282.4550200.0001
Check MTime0.00110.9843200.0001
Mysql Total
Database connection0.00060.501810.0006
Mysqli_queries0.078167.80901410.0006
Looping result0.00080.68161390.0000
Template Total0.104090.310.1040
Template load0.00070.642310.0007
Template processing0.103389.632610.1033
Override
Cache load0.00050.468710.0005
Sytem overhead
Fetch class attribute can translate value0.00040.348010.0004
XML
Image XML parsing0.00020.165710.0002
General
dbfile0.00786.7369200.0004
String conversion0.00000.003530.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.0002 secs