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

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 02:46:45
Script start
Timing: Jan 18 2025 02:46:45
Module start 'layout'
Timing: Jan 18 2025 02:46:45
Module start 'content'
Warning: PHP: E_DEPRECATED Jan 18 2025 02:46:47
trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ze/public_html/share.se7enx.com/var/community/cache/template/compiled/table-02cf899a6d707917c58210ed54ffe2ff.php on line 147
Timing: Jan 18 2025 02:46:47
Module end 'content'
Timing: Jan 18 2025 02:46:47
Script end

Main resources:

Total runtime2.3227 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.1328152.6250
Module start 'layout' 0.00770.0042 741.757839.4453
Module start 'content' 0.01192.3092 781.2031714.8438
Module end 'content' 2.32100.0016 1,496.046924.3672
Script end 2.3226  1,520.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.1781160.0003
Check MTime0.00200.0843160.0001
Mysql Total
Database connection0.00110.045910.0011
Mysqli_queries2.202994.8456830.0265
Looping result0.00100.0447810.0000
Template Total2.284798.421.1423
Template load0.00240.102020.0012
Template processing2.282398.261121.1411
Template load and register function0.00010.004410.0001
states
state_id_array0.00100.041210.0010
state_identifier_array0.00230.097220.0011
Override
Cache load0.00220.0940780.0000
Sytem overhead
Fetch class attribute can translate value0.00100.044540.0003
Fetch class attribute name0.00200.0843130.0002
XML
Image XML parsing0.00250.109540.0006
class_abstraction
Instantiating content class attribute0.00000.0019190.0000
General
dbfile0.00130.0563300.0000
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
10content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
4content/datatype/view/ezxmltags/td.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/td.tplEdit templateOverride template
4content/datatype/view/ezxmltags/tr.tpl<No override>extension/community/design/community/templates/content/datatype/view/ezxmltags/tr.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/table.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/table.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 45
 Number of unique templates used: 11

Time used to render debug report: 0.0002 secs