File tree 3 files changed +23
-0
lines changed
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
CHANGES
2
2
3
+ 2014-06-02
4
+ - add retry_on_conflict support to bulk #623
5
+
3
6
2014-06-01
4
7
- toString updated to consider doc_as_upsert if sent an array source #622
5
8
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ protected function _getMetadataByDocument(Document $document)
42
42
'parent ' ,
43
43
'ttl ' ,
44
44
'timestamp ' ,
45
+ 'retry_on_conflict ' ,
45
46
);
46
47
$ metadata = $ document ->getOptions ($ params , true );
47
48
Original file line number Diff line number Diff line change @@ -616,6 +616,25 @@ public function testGetPath()
616
616
$ this ->assertEquals ($ indexName . '/ ' . $ typeName . '/_bulk ' , $ bulk ->getPath ());
617
617
}
618
618
619
+ public function testRetry ()
620
+ {
621
+ $ index = $ this ->_createIndex ();
622
+ $ type = $ index ->getType ('bulk_test ' );
623
+ $ client = $ index ->getClient ();
624
+
625
+ $ doc1 = $ type ->createDocument (1 , array ('name ' => 'Mister Fantastic ' ));
626
+ $ doc1 ->setOpType (Action::OP_TYPE_UPDATE );
627
+ $ doc1 ->setRetryOnConflict (5 );
628
+
629
+ $ bulk = new Bulk ($ client );
630
+ $ bulk ->addDocument ($ doc1 );
631
+
632
+ $ actions = $ bulk ->getActions ();
633
+
634
+ $ metadata = $ actions [0 ]->getMetadata ();
635
+ $ this ->assertEquals (5 , $ metadata [ '_retry_on_conflict ' ]);
636
+ }
637
+
619
638
public function udpDataProvider ()
620
639
{
621
640
return array (
You can’t perform that action at this time.
0 commit comments