Hi,
When adding documents 200 at a time, the index is created, but the log reports:

Apache Solr	10:23, 20-01-2012	Indexing succeeded on 0 
Apache Solr	10:23, 20-01-2012	Adding 0 documents.	
CommentFileSizeAuthor
#5 1411354-5.patch1.88 KBnick_vh

Comments

stephenrobinson’s picture

apachesolr_index_send_to_solr seems to be called too mant times

log report:

Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 0 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 0 documents.	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Indexing succeeded on 3 documents	Stephen Robinso...	
	Apache Solr	11:23, 20-01-2012	Adding 3 documents.	Stephen Robinso...

added a debug line to apachesolr.index.inc

function apachesolr_index_send_to_solr($env_id, $documents) {
  drupal_set_message('<pre>'.htmlspecialchars(print_r($documents,1)).'</pre>');

and I got:

    *

      Array
      (
      )

    *

      Array
      (
          [0] => ApacheSolrDocument Object
              (
                  [_documentBoost:protected] => 
                  [_fields:protected] => Array
                      (
                          [id] => arse/node/3838
                          [site] => http://web-wwwdrupaldev.internal.sanger.ac.uk:8000/
                          [hash] => arse
                          [entity_id] => 3838
                          [entity_type] => node
                          [bundle] => campus_event
                          [bundle_name] => Campus Event
                          [path] => node/3838
                          [url] => http://web-wwwdrupaldev.internal.sanger.ac.uk:8000/campus-events/green-focus-group-meeting
                          [language] => und
                          [path_alias] => campus-events/green-focus-group-meeting
                          [label] => Green Focus Group Meeting
                          [content] =>         xxxxxxxxxxxxxxxxxxx        
                          [teaser] =>         xxxxxxxxxxxxxxxxxxx  
                          [ss_name] => kh
                          [tos_name] => kh
                          [ss_name_formatted] => Karen Hampson
                          [tos_name_formatted] => Karen Hampson
                          [is_uid] => 21
                          [bs_status] => 1
                          [bs_sticky] => 0
                          [bs_promote] => 0
                          [is_tnid] => 0
                          [bs_translate] => 0
                          [ss_language] => und
                          [ds_created] => 2012-01-04T14:40:15Z
                          [ds_changed] => 2012-01-20T10:26:11Z
                          [ds_last_comment_or_change] => 2012-01-20T10:26:11Z
                          [is_comment_count] => 0
                          [type_name] => Campus Event
                          [created] => 2012-01-04T14:40:15Z
                          [changed] => 2012-01-20T10:26:11Z
                          [last_comment_or_change] => 2012-01-20T10:26:11Z
                          [comment_count] => 0
                          [name] => Karen Hampson
                          [tos_content_extra] => 
                          [im_taxonomy_vocabulary_9] => Array
                              (
                                  [0] => 476
                                  [1] => 461
                              )

                          [tid] => Array
                              (
                                  [0] => 476
                                  [1] => 461
                              )

                          [im_vid_9] => Array
                              (
                                  [0] => 476
                                  [1] => 461
                              )

                          [sm_vid_Event_Type] => Array
                              (
                                  [0] => Campus Events
                                  [1] => Event
                              )

                          [tm_vid_9_names] => Array
                              (
                                  [0] => Campus Events Event
                              )

                          [access__all] => Array
                              (
                                  [0] => 0
                              )

                      )

                  [_fieldBoosts:protected] => Array
                      (
                          [id] => 
                          [site] => 
                          [hash] => 
                          [entity_id] => 
                          [entity_type] => 
                          [bundle] => 
                          [bundle_name] => 
                          [path] => 
                          [url] => 
                          [language] => 
                          [path_alias] => 
                          [label] => 
                          [content] => 
                          [teaser] => 
                          [ss_name] => 
                          [tos_name] => 
                          [ss_name_formatted] => 
                          [tos_name_formatted] => 
                          [is_uid] => 
                          [bs_status] => 
                          [bs_sticky] => 
                          [bs_promote] => 
                          [is_tnid] => 
                          [bs_translate] => 
                          [ss_language] => 
                          [ds_created] => 
                          [ds_changed] => 
                          [ds_last_comment_or_change] => 
                          [is_comment_count] => 
                          [type_name] => 
                          [created] => 
                          [changed] => 
                          [last_comment_or_change] => 
                          [comment_count] => 
                          [name] => 
                          [tos_content_extra] => 
                          [im_taxonomy_vocabulary_9] => 
                          [tid] => 
                          [im_vid_9] => 
                          [sm_vid_Event_Type] => 
                          [tm_vid_9_names] => 
                          [access__all] => 
                      )

              )

          [1] => ApacheSolrDocument Object
              (
                  [_documentBoost:protected] => 
                  [_fields:protected] => Array
                      (
                          [id] => arse/node/3839
                          [site] => http://web-wwwdrupaldev.internal.sanger.ac.uk:8000/
                          [hash] => arse
                          [entity_id] => 3839
                          [entity_type] => node
                          [bundle] => page
                          [bundle_name] => Page
                          [path] => node/3839
                          [url] => http://web-wwwdrupaldev.internal.sanger.ac.uk:8000/content/create-page
                          [language] => und
                          [path_alias] => content/create-page
                          [label] => aaaaaaaaaaaaaaaaaaaaaaa
                          [content] =>         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa        
                          [teaser] =>         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa        
                          [ss_name] => Admin
                          [tos_name] => Admin
                          [ss_name_formatted] => Stephen Robinson (Admin)
                          [tos_name_formatted] => Stephen Robinson (Admin)
                          [is_uid] => 1
                          [bs_status] => 1
                          [bs_sticky] => 0
                          [bs_promote] => 0
                          [is_tnid] => 0
                          [bs_translate] => 0
                          [ss_language] => und
                          [ds_created] => 2012-01-20T10:22:37Z
                          [ds_changed] => 2012-01-20T10:22:37Z
                          [ds_last_comment_or_change] => 2012-01-20T10:22:37Z
                          [is_comment_count] => 0
                          [type_name] => Page
                          [created] => 2012-01-20T10:22:37Z
                          [changed] => 2012-01-20T10:22:37Z
                          [last_comment_or_change] => 2012-01-20T10:22:37Z
                          [comment_count] => 0
                          [name] => Stephen Robinson (Admin)
                          [tos_content_extra] => 
                          [access__all] => Array
                              (
                                  [0] => 0
                              )

                      )

                  [_fieldBoosts:protected] => Array
                      (
                          [id] => 
                          [site] => 
                          [hash] => 
                          [entity_id] => 
                          [entity_type] => 
                          [bundle] => 
                          [bundle_name] => 
                          [path] => 
                          [url] => 
                          [language] => 
                          [path_alias] => 
                          [label] => 
                          [content] => 
                          [teaser] => 
                          [ss_name] => 
                          [tos_name] => 
                          [ss_name_formatted] => 
                          [tos_name_formatted] => 
                          [is_uid] => 
                          [bs_status] => 
                          [bs_sticky] => 
                          [bs_promote] => 
                          [is_tnid] => 
                          [bs_translate] => 
                          [ss_language] => 
                          [ds_created] => 
                          [ds_changed] => 
                          [ds_last_comment_or_change] => 
                          [is_comment_count] => 
                          [type_name] => 
                          [created] => 
                          [changed] => 
                          [last_comment_or_change] => 
                          [comment_count] => 
                          [name] => 
                          [tos_content_extra] => 
                          [access__all] => 
                      )

              )

          [2] => ApacheSolrDocument Object
              (
                  [_documentBoost:protected] => 
                  [_fields:protected] => Array
                      (
                          [id] => arse/node/3840
                          [site] => http://web-wwwdrupaldev.internal.sanger.ac.uk:8000/
                          [hash] => arse
                          [entity_id] => 3840
                          [entity_type] => node
                          [bundle] => page
                          [bundle_name] => Page
                          [path] => node/3840
                          [url] => http://web-wwwdrupaldev.internal.sanger.ac.uk:8000/content/create-page-0
                          [language] => und
                          [path_alias] => content/create-page-0
                          [label] => xxxxxxxxxxxxxxxxxxxxxxxxxx
                          [content] =>         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx        
                          [teaser] =>         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx        
                          [ss_name] => Admin
                          [tos_name] => Admin
                          [ss_name_formatted] => Stephen Robinson (Admin)
                          [tos_name_formatted] => Stephen Robinson (Admin)
                          [is_uid] => 1
                          [bs_status] => 1
                          [bs_sticky] => 0
                          [bs_promote] => 0
                          [is_tnid] => 0
                          [bs_translate] => 0
                          [ss_language] => und
                          [ds_created] => 2012-01-20T10:22:47Z
                          [ds_changed] => 2012-01-20T10:22:47Z
                          [ds_last_comment_or_change] => 2012-01-20T10:22:47Z
                          [is_comment_count] => 0
                          [type_name] => Page
                          [created] => 2012-01-20T10:22:47Z
                          [changed] => 2012-01-20T10:22:47Z
                          [last_comment_or_change] => 2012-01-20T10:22:47Z
                          [comment_count] => 0
                          [name] => Stephen Robinson (Admin)
                          [tos_content_extra] => 
                          [access__all] => Array
                              (
                                  [0] => 0
                              )

                      )

                  [_fieldBoosts:protected] => Array
                      (
                          [id] => 
                          [site] => 
                          [hash] => 
                          [entity_id] => 
                          [entity_type] => 
                          [bundle] => 
                          [bundle_name] => 
                          [path] => 
                          [url] => 
                          [language] => 
                          [path_alias] => 
                          [label] => 
                          [content] => 
                          [teaser] => 
                          [ss_name] => 
                          [tos_name] => 
                          [ss_name_formatted] => 
                          [tos_name_formatted] => 
                          [is_uid] => 
                          [bs_status] => 
                          [bs_sticky] => 
                          [bs_promote] => 
                          [is_tnid] => 
                          [bs_translate] => 
                          [ss_language] => 
                          [ds_created] => 
                          [ds_changed] => 
                          [ds_last_comment_or_change] => 
                          [is_comment_count] => 
                          [type_name] => 
                          [created] => 
                          [changed] => 
                          [last_comment_or_change] => 
                          [comment_count] => 
                          [name] => 
                          [tos_content_extra] => 
                          [access__all] => 
                      )

              )

      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    *

      Array
      (
      )

    * Apachesolr cron succesfully executed
stephenrobinson’s picture

Cured the symptoms (not the cause) with a couple of extra lines:

function apachesolr_index_send_to_solr($env_id, $documents) {
  if(count($documents)<1){ // added
    return; // added
  } // added
pjcdawkins’s picture

Priority: Minor » Normal

I have the same problem, and it seems to give me performance issues.

nick_vh’s picture

Status: Active » Needs work

I'll dive into this

nick_vh’s picture

Status: Needs work » Needs review
StatusFileSize
new1.88 KB

Patched it in both of the functions. This should resolve the log errors

pwolanin’s picture

Title: Incorrect log reporting » Incorrect reporting of documents indexed
Version: 7.x-1.0-beta15 » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

committed to 7.x

nick_vh’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x-3.x

nick_vh’s picture

Status: Fixed » Closed (fixed)