Details

      Description

      When using a field criterion with a timestamp of zero, a string is generated instead of a integer

      new Criterion\Field('start_date', Op::GT, 0);
      

      leads to

      (my_content_type_start_date_value_dt:{"0" TO *})
      

      which result in an error

      ->response not set: array (
      0 =>
      ...
      'error' =>
      stdClass::__set_state(array(
      'msg' => 'Invalid Date String:\'0\'',
      'code' => 400,
      )),
      ...
      

      Steps to reproduce:

      1. Prepare a test eZ Publish 5.4 instalation, fully updated to 5.4.5;
      2. Install Solr Search Engine Bundle, as described here:

      https://doc.ez.no/display/EZP/Solr+Search+Engine+Bundle

      3. Create a new test bundle, and then create a new test command that uses a field criterion with a timestamp of zero:

      new Criterion\Field('publish_date', Operator::GT, 0);
      

      For reference, please use the attached "SearchCommand.php" command, and adapt namespace etc as needed. The example command works with contents of type "article".

      4. Run the command from the console. The following exception is generated:

      [RuntimeException]                                                                                                                                                          
        ->response not set: array (                                                                                                                                                 
          0 =>                                                                                                                                                                      
          stdClass::__set_state(array(                                                                                                                                              
             'responseHeader' =>                                                                                                                                                    
            stdClass::__set_state(array(                                                                                                                                            
               'status' => 400,                                                                                                                                                     
               'QTime' => 65,                                                                                                                                                       
               'params' =>                                                                                                                                                          
              stdClass::__set_state(array(                                                                                                                                          
                 'shards' => 'localhost:8983/solr/collection1',                                                                                                                     
                 'defType' => 'edismax',                                                                                                                                            
                 'q.alt' => '((type_id:"16") AND (language_code_ms:"eng-GB" OR always_available_b:true) AND (article_publish_date_value_dt:{"0" TO *}))',                           
                 'fl' => '*,score,[shard]',                                                                                                                                         
                 'start' => '0',                                                                                                                                                    
                 'fq' => '((document_type_id:"content") AND (*:* AND ((section_id:"1") OR ((type_id:"27" OR type_id:"35" OR type_id:"37" OR type_id:"26") AND (section_id:"3")) OR  
         (section_id:"7"))) AND (meta_indexed_is_main_translation_b:"true"))',                                                                                                      
                 'sort' => '',                                                                                                                                                      
                 'rows' => '25',                                                                                                                                                    
                 'wt' => 'json',                                                                                                                                                    
              )),                                                                                                                                                                   
            )),                                                                                                                                                                     
             'error' =>                                                                                                                                                             
            stdClass::__set_state(array(                                                                                                                                            
               'msg' => 'Invalid Date String:\'0\'',                                                                                                                                
               'code' => 400,                                                                                                                                                       
            )),                                                                                                                                                                     
          )),                                                                                                                                                                       
          1 =>                                                                                                                                                                      
          array (                                                                                                                                                                   
            'defType' => 'edismax',                                                                                                                                                 
            'q.alt' => '((type_id:"16") AND (language_code_ms:"eng-GB" OR always_available_b:true) AND (article_publish_date_value_dt:{"0" TO *}))',                                
            'fq' => '((document_type_id:"content") AND (*:* AND ((section_id:"1") OR ((type_id:"27" OR type_id:"35" OR type_id:"37" OR type_id:"26") AND (section_id:"3")) OR (sec  
        tion_id:"7"))) AND (meta_indexed_is_main_translation_b:"true"))',                                                                                                           
            'sort' => '',                                                                                                                                                           
            'start' => 0,                                                                                                                                                           
            'rows' => 25,                                                                                                                                                           
            'fl' => '*,score,[shard]',                                                                                                                                              
            'wt' => 'json',                                                                                                                                                         
            'shards' => 'localhost:8983/solr/collection1',                                                                                                                          
          ),                                                                                                                                                                        
        )    
      

        Issue Links

          Activity

          Show
          Joao Inacio (Inactive) added a comment - PR: https://github.com/ezsystems/ezplatform-solr-search-engine/pull/35
          Show
          André Rømcke added a comment - - edited Kernel change merged master: https://github.com/ezsystems/ezpublish-kernel/commit/702e62bdc3405336bdc65acdbc49a059fe58def0 6.1: https://github.com/ezsystems/ezpublish-kernel/commit/822cacc0fa8a07e2704c1ad73f78c48be4f7c737
          Hide
          Bertrand Dunogier added a comment -

          Still blocked by the solr pull-request: https://github.com/ezsystems/ezplatform-solr-search-engine/pull/35. Waiting for feedback from [~joao.inacio@ez.no].

          Show
          Bertrand Dunogier added a comment - Still blocked by the solr pull-request: https://github.com/ezsystems/ezplatform-solr-search-engine/pull/35 . Waiting for feedback from [~joao.inacio@ez.no] .
          Hide
          Bertrand Dunogier added a comment -

          Need to resolve travis memory issues before we merge. That aside all good.

          Show
          Bertrand Dunogier added a comment - Need to resolve travis memory issues before we merge. That aside all good.
          Hide
          André Rømcke added a comment -
          Show
          André Rømcke added a comment - Additional fixes in kernel: 6.3 & master: https://github.com/ezsystems/ezpublish-kernel/commit/27f2b3a840b6e261a539ec23bf25c0761481d99a
          Show
          André Rømcke added a comment - Merged to solr bundle: https://github.com/ezsystems/ezplatform-solr-search-engine/commit/2e0a5770784a14ea796b925a3bf263fb64f4a30c https://github.com/ezsystems/ezplatform-solr-search-engine/commit/14081928e49a19ede9212b06adb429063ee6a538
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 5.4, 6.3 and master.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.4, 6.3 and master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Hannes Giesenow
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m