Details
-
Bug
-
Resolution: Fixed
-
High
-
5.4.5
-
None
-
SolrSearchEngine 1.0.1 together with ezpublish 5.4.5
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', ), )
Attachments
Issue Links
- links to