From 1cf11c5798c058b1c0c70005462294d1ccb07bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:21:23 +0300 Subject: [PATCH 01/15] Fixes search by multiple attributes --- docs/searchclass.md | 7 +++-- src/Manticoresearch/Search.php | 15 +++------ test/Manticoresearch/SearchTest.php | 47 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/docs/searchclass.md b/docs/searchclass.md index 98141f47..7b38df76 100755 --- a/docs/searchclass.md +++ b/docs/searchclass.md @@ -154,12 +154,13 @@ $search->sort('tags','asc','max'); `Sort` can also accept the first argument as an array with key-value pairs as attribute -> direction: ```php -$search->sort(['name'=>'asc']); +$search->sort(['name'=>'asc', 'tags'=>'asc']); ```` + By default, rules are added to the existing ones. If the second argument is set, the input array will not be added but will replace an existing rule set. ```php -$search->sort(['name'=>'desc'],true); +$search->sort(['name'=>'asc', 'tags'=>'asc'], true); ```` The first argument can also be a geo distance sort expression: @@ -285,4 +286,4 @@ Provides query profiling in the result set. This method clears all search conditions, including the index name. - \ No newline at end of file + diff --git a/src/Manticoresearch/Search.php b/src/Manticoresearch/Search.php index ec123677..5cd5c5d8 100755 --- a/src/Manticoresearch/Search.php +++ b/src/Manticoresearch/Search.php @@ -264,17 +264,12 @@ public function sort($field, $direction = 'asc', $mode = null): self { if (is_array($field)) { //if 2nd arg is true we full set the sort with the expr, otherwise just add it //we let passing uppercased directions here as well - foreach ($field as $k => $v) { - if (!is_string($v)) { - continue; - } - - $field[$k] = strtolower($v); + if (empty($this->params['sort']) || (isset($direction) && $direction === true)) { + $this->params['sort'] = []; } - if (isset($direction) && $direction === true) { - $this->params['sort'] = $field; - } else { - $this->params['sort'] [] = $field; + + foreach ($field as $k => $v) { + $this->params['sort'][] = [$k => strtolower($v)]; } return $this; } diff --git a/test/Manticoresearch/SearchTest.php b/test/Manticoresearch/SearchTest.php index 08050851..3aa22627 100755 --- a/test/Manticoresearch/SearchTest.php +++ b/test/Manticoresearch/SearchTest.php @@ -152,6 +152,29 @@ private function yearsFromResults($results, $sort = false) { return $years; } + /** + * Helper method to return just the titles from the results. This is used to validate filtering and sorting + * @param ResultSet $results + * @param boolean $sort since Manticore 4 we don't implicitly sort by id, so the results can be sorted + * randomly especially when there's no other implicit/explicit sorting (e.g. full-text ranking), so it makes + * sense to sort explicitly + */ + private function titlesFromResults($results, $sort = false): array + { + $titles = []; + while ($results->valid()) { + $hit = $results->current(); + $data = $hit->getData(); + $titles[] = $data['title']; + $results->next(); + } + if ($sort != false) { + sort($titles); + } + + return $titles; + } + protected function getResultSet() { return static::$search->search('"team of explorers"/2')->get(); } @@ -299,6 +322,30 @@ public function testSortMethodDescending() { $this->assertEquals([2014,1992,1986], $this->yearsFromResults($results)); } + public function testSortMethodNyMultipleAttributesAscending() + { + $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'asc'])->get(); + $this->assertEquals([ + 'Aliens', + 'Alien', + '1917', + 'Interstellar', + 'Inception', + ], $this->titlesFromResults($results)); + } + + public function testSortMethodNyMultipleAttributesDescending() + { + $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'desc'])->get(); + $this->assertEquals([ + 'Aliens', + '1917', + 'Alien', + 'Interstellar', + 'Inception', + ], $this->titlesFromResults($results)); + } + public function testOffsetMethod() { $results = static::$search->offset(0)->phrase('team of explorers')->get(); $this->assertEquals([1986,2014,1992], $this->yearsFromResults($results)); From 2f15624e52ee7c071e524983c22451aef190d766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:23:46 +0300 Subject: [PATCH 02/15] upd --- src/Manticoresearch/Search.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Manticoresearch/Search.php b/src/Manticoresearch/Search.php index 5cd5c5d8..fa8d17d0 100755 --- a/src/Manticoresearch/Search.php +++ b/src/Manticoresearch/Search.php @@ -269,7 +269,11 @@ public function sort($field, $direction = 'asc', $mode = null): self { } foreach ($field as $k => $v) { - $this->params['sort'][] = [$k => strtolower($v)]; + if (!is_string($v)) { + continue; + } + + $this->params['sort'][] = [$k => strtolower($v)]; } return $this; } From 533ebf1c5cb9868f33fea90b690c4d0890b08be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:24:23 +0300 Subject: [PATCH 03/15] upd --- src/Manticoresearch/Search.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Manticoresearch/Search.php b/src/Manticoresearch/Search.php index fa8d17d0..4c23db09 100755 --- a/src/Manticoresearch/Search.php +++ b/src/Manticoresearch/Search.php @@ -269,11 +269,11 @@ public function sort($field, $direction = 'asc', $mode = null): self { } foreach ($field as $k => $v) { - if (!is_string($v)) { - continue; - } + if (!is_string($v)) { + continue; + } - $this->params['sort'][] = [$k => strtolower($v)]; + $this->params['sort'][] = [$k => strtolower($v)]; } return $this; } From 1b22ba17ea1dc78c2b018d7f3f220cca38d68996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:25:37 +0300 Subject: [PATCH 04/15] upd --- test/Manticoresearch/SearchTest.php | 90 ++++++++++++++--------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/test/Manticoresearch/SearchTest.php b/test/Manticoresearch/SearchTest.php index 3aa22627..e7bdd104 100755 --- a/test/Manticoresearch/SearchTest.php +++ b/test/Manticoresearch/SearchTest.php @@ -152,28 +152,28 @@ private function yearsFromResults($results, $sort = false) { return $years; } - /** - * Helper method to return just the titles from the results. This is used to validate filtering and sorting - * @param ResultSet $results - * @param boolean $sort since Manticore 4 we don't implicitly sort by id, so the results can be sorted - * randomly especially when there's no other implicit/explicit sorting (e.g. full-text ranking), so it makes - * sense to sort explicitly - */ - private function titlesFromResults($results, $sort = false): array - { - $titles = []; - while ($results->valid()) { - $hit = $results->current(); - $data = $hit->getData(); - $titles[] = $data['title']; - $results->next(); - } - if ($sort != false) { - sort($titles); - } - - return $titles; - } + /** + * Helper method to return just the titles from the results. This is used to validate filtering and sorting + * @param ResultSet $results + * @param boolean $sort since Manticore 4 we don't implicitly sort by id, so the results can be sorted + * randomly especially when there's no other implicit/explicit sorting (e.g. full-text ranking), so it makes + * sense to sort explicitly + */ + private function titlesFromResults($results, $sort = false): array + { + $titles = []; + while ($results->valid()) { + $hit = $results->current(); + $data = $hit->getData(); + $titles[] = $data['title']; + $results->next(); + } + if ($sort != false) { + sort($titles); + } + + return $titles; + } protected function getResultSet() { return static::$search->search('"team of explorers"/2')->get(); @@ -322,29 +322,29 @@ public function testSortMethodDescending() { $this->assertEquals([2014,1992,1986], $this->yearsFromResults($results)); } - public function testSortMethodNyMultipleAttributesAscending() - { - $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'asc'])->get(); - $this->assertEquals([ - 'Aliens', - 'Alien', - '1917', - 'Interstellar', - 'Inception', - ], $this->titlesFromResults($results)); - } - - public function testSortMethodNyMultipleAttributesDescending() - { - $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'desc'])->get(); - $this->assertEquals([ - 'Aliens', - '1917', - 'Alien', - 'Interstellar', - 'Inception', - ], $this->titlesFromResults($results)); - } + public function testSortMethodNyMultipleAttributesAscending() + { + $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'asc'])->get(); + $this->assertEquals([ + 'Aliens', + 'Alien', + '1917', + 'Interstellar', + 'Inception', + ], $this->titlesFromResults($results)); + } + + public function testSortMethodNyMultipleAttributesDescending() + { + $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'desc'])->get(); + $this->assertEquals([ + 'Aliens', + '1917', + 'Alien', + 'Interstellar', + 'Inception', + ], $this->titlesFromResults($results)); + } public function testOffsetMethod() { $results = static::$search->offset(0)->phrase('team of explorers')->get(); From 5099dea3431a921951174974c4e1afce125d9351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:35:52 +0300 Subject: [PATCH 05/15] fix --- test/Manticoresearch/SearchTest.php | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/test/Manticoresearch/SearchTest.php b/test/Manticoresearch/SearchTest.php index e7bdd104..39850c01 100755 --- a/test/Manticoresearch/SearchTest.php +++ b/test/Manticoresearch/SearchTest.php @@ -81,7 +81,7 @@ protected static function indexDocuments(): Search { ], ]], ['insert' => ['index' => 'movies', 'id' => 4, 'doc' => - ['title' => '1917 ', 'plot' => ' As a regiment assembles to wage war deep in enemy territory, two'. + ['title' => '1917', 'plot' => ' As a regiment assembles to wage war deep in enemy territory, two'. ' soldiers are assigned to race against time and deliver a message that will stop 1,600 men from'. ' walking straight into a deadly trap.', 'year' => 2018, 'rating' => 8.4, @@ -159,8 +159,7 @@ private function yearsFromResults($results, $sort = false) { * randomly especially when there's no other implicit/explicit sorting (e.g. full-text ranking), so it makes * sense to sort explicitly */ - private function titlesFromResults($results, $sort = false): array - { + private function titlesFromResults($results, $sort = false): array { $titles = []; while ($results->valid()) { $hit = $results->current(); @@ -168,7 +167,7 @@ private function titlesFromResults($results, $sort = false): array $titles[] = $data['title']; $results->next(); } - if ($sort != false) { + if ($sort !== false) { sort($titles); } @@ -322,28 +321,14 @@ public function testSortMethodDescending() { $this->assertEquals([2014,1992,1986], $this->yearsFromResults($results)); } - public function testSortMethodNyMultipleAttributesAscending() - { + public function testSortMethodNyMultipleAttributesAscending() { $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'asc'])->get(); - $this->assertEquals([ - 'Aliens', - 'Alien', - '1917', - 'Interstellar', - 'Inception', - ], $this->titlesFromResults($results)); + $this->assertEquals(['Aliens', 'Alien', '1917', 'Interstellar', 'Inception'], $this->titlesFromResults($results)); } - public function testSortMethodNyMultipleAttributesDescending() - { + public function testSortMethodNyMultipleAttributesDescending() { $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'desc'])->get(); - $this->assertEquals([ - 'Aliens', - '1917', - 'Alien', - 'Interstellar', - 'Inception', - ], $this->titlesFromResults($results)); + $this->assertEquals(['Aliens', '1917', 'Alien', 'Interstellar', 'Inception'], $this->titlesFromResults($results)); } public function testOffsetMethod() { From fd4e5d12e39c1130e4ea0b08f856e40f36577738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:39:06 +0300 Subject: [PATCH 06/15] fix --- test/Manticoresearch/SearchTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Manticoresearch/SearchTest.php b/test/Manticoresearch/SearchTest.php index 39850c01..e0fce0bd 100755 --- a/test/Manticoresearch/SearchTest.php +++ b/test/Manticoresearch/SearchTest.php @@ -322,12 +322,14 @@ public function testSortMethodDescending() { } public function testSortMethodNyMultipleAttributesAscending() { - $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'asc'])->get(); + $results = self::$search->filter('rating', 'gte', 8.3) + ->sort(['rating' => 'asc','year' => 'asc'])->get(); $this->assertEquals(['Aliens', 'Alien', '1917', 'Interstellar', 'Inception'], $this->titlesFromResults($results)); } public function testSortMethodNyMultipleAttributesDescending() { - $results = self::$search->filter('rating', 'gte', 8.3)->sort(['rating' => 'asc','year' => 'desc'])->get(); + $results = self::$search->filter('rating', 'gte', 8.3) + ->sort(['rating' => 'asc','year' => 'desc'])->get(); $this->assertEquals(['Aliens', '1917', 'Alien', 'Interstellar', 'Inception'], $this->titlesFromResults($results)); } From be57a8664436f765c21f2f9b3cacd94cbf00ac61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Mon, 29 Jan 2024 17:41:49 +0300 Subject: [PATCH 07/15] fix --- test/Manticoresearch/SearchTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Manticoresearch/SearchTest.php b/test/Manticoresearch/SearchTest.php index e0fce0bd..ea3df4d4 100755 --- a/test/Manticoresearch/SearchTest.php +++ b/test/Manticoresearch/SearchTest.php @@ -324,13 +324,13 @@ public function testSortMethodDescending() { public function testSortMethodNyMultipleAttributesAscending() { $results = self::$search->filter('rating', 'gte', 8.3) ->sort(['rating' => 'asc','year' => 'asc'])->get(); - $this->assertEquals(['Aliens', 'Alien', '1917', 'Interstellar', 'Inception'], $this->titlesFromResults($results)); + $this->assertEquals(['Aliens','Alien','1917','Interstellar','Inception'], $this->titlesFromResults($results)); } public function testSortMethodNyMultipleAttributesDescending() { $results = self::$search->filter('rating', 'gte', 8.3) ->sort(['rating' => 'asc','year' => 'desc'])->get(); - $this->assertEquals(['Aliens', '1917', 'Alien', 'Interstellar', 'Inception'], $this->titlesFromResults($results)); + $this->assertEquals(['Aliens','1917','Alien','Interstellar','Inception'], $this->titlesFromResults($results)); } public function testOffsetMethod() { From 18a8adf843c49539bf22cd3eac6f9c63d7906b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Wed, 30 Oct 2024 17:42:15 +0300 Subject: [PATCH 08/15] Adds method to unset last response in Client --- src/Manticoresearch/Client.php | 8 ++++++++ test/Manticoresearch/ClientTest.php | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/Manticoresearch/Client.php b/src/Manticoresearch/Client.php index 7a9c2499..9130136d 100755 --- a/src/Manticoresearch/Client.php +++ b/src/Manticoresearch/Client.php @@ -421,4 +421,12 @@ public function request(Request $request, array $params = []): Response { public function getLastResponse(): Response { return $this->lastResponse; } + + /* + * + * @return void + */ + public function unsetLastResponse(): void { + $this->lastResponse = null; + } } diff --git a/test/Manticoresearch/ClientTest.php b/test/Manticoresearch/ClientTest.php index 3b6871ec..1c90a64c 100644 --- a/test/Manticoresearch/ClientTest.php +++ b/test/Manticoresearch/ClientTest.php @@ -167,4 +167,27 @@ public function testGetLastResponse() { $lastResponse = $client->getLastResponse()->getResponse(); $this->assertEquals($result, $lastResponse); } + public function testUnsetLastResponse() { + $helper = new PopulateHelperTest(); + $helper->populateForKeywords(); + $client = $helper->getClient(); + + $payload = [ + 'body' => [ + 'index' => 'products', + 'query' => [ + 'match' => ['*' => 'broken'], + ], + ], + ]; + + $result = $client->search($payload); + $lastResponse = $client->getLastResponse()->getResponse(); + $this->assertEquals($result, $lastResponse); + + $client->unsetLastResponse(); + + $lastResponse = $client->getLastResponse()->getResponse(); + $this->assertNull($lastResponse); + } } From 81f994336a6c5ca610e0420f6685311a62ff9bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Wed, 30 Oct 2024 18:29:16 +0300 Subject: [PATCH 09/15] getLastResponse(): ?Response --- src/Manticoresearch/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manticoresearch/Client.php b/src/Manticoresearch/Client.php index 9130136d..4f20fd55 100755 --- a/src/Manticoresearch/Client.php +++ b/src/Manticoresearch/Client.php @@ -418,7 +418,7 @@ public function request(Request $request, array $params = []): Response { * * @return Response */ - public function getLastResponse(): Response { + public function getLastResponse(): ?Response { return $this->lastResponse; } From d6176c979a1de458fb8c7c0d22ae630a2b3e4736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Wed, 30 Oct 2024 18:33:34 +0300 Subject: [PATCH 10/15] test fix --- test/Manticoresearch/ClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Manticoresearch/ClientTest.php b/test/Manticoresearch/ClientTest.php index 1c90a64c..6f3f78d5 100644 --- a/test/Manticoresearch/ClientTest.php +++ b/test/Manticoresearch/ClientTest.php @@ -187,7 +187,7 @@ public function testUnsetLastResponse() { $client->unsetLastResponse(); - $lastResponse = $client->getLastResponse()->getResponse(); + $lastResponse = $client->getLastResponse(); $this->assertNull($lastResponse); } } From 86a5642c00d2b7ea7aa3f9307364226b2eac530e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Wed, 30 Oct 2024 19:00:01 +0300 Subject: [PATCH 11/15] test fix --- src/Manticoresearch/Client.php | 4 ++-- test/Manticoresearch/ClientTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Manticoresearch/Client.php b/src/Manticoresearch/Client.php index 4f20fd55..1e7952e4 100755 --- a/src/Manticoresearch/Client.php +++ b/src/Manticoresearch/Client.php @@ -418,7 +418,7 @@ public function request(Request $request, array $params = []): Response { * * @return Response */ - public function getLastResponse(): ?Response { + public function getLastResponse(): Response { return $this->lastResponse; } @@ -427,6 +427,6 @@ public function getLastResponse(): ?Response { * @return void */ public function unsetLastResponse(): void { - $this->lastResponse = null; + $this->lastResponse = new Response([], null, []); } } diff --git a/test/Manticoresearch/ClientTest.php b/test/Manticoresearch/ClientTest.php index 6f3f78d5..cb9b231b 100644 --- a/test/Manticoresearch/ClientTest.php +++ b/test/Manticoresearch/ClientTest.php @@ -187,7 +187,7 @@ public function testUnsetLastResponse() { $client->unsetLastResponse(); - $lastResponse = $client->getLastResponse(); - $this->assertNull($lastResponse); + $lastResponse = $client->getLastResponse()->getResponse(); + $this->assertEquals([], $lastResponse); } } From 68d8cba045538a8a87c51da07a7f4b1011715a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 31 Oct 2024 16:07:36 +0300 Subject: [PATCH 12/15] test fix --- test/Manticoresearch/Endpoints/InsertTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Manticoresearch/Endpoints/InsertTest.php b/test/Manticoresearch/Endpoints/InsertTest.php index 887a2676..5db0dc6f 100644 --- a/test/Manticoresearch/Endpoints/InsertTest.php +++ b/test/Manticoresearch/Endpoints/InsertTest.php @@ -34,11 +34,12 @@ public function testInsert() { ], ]; $response = $client->insert(['body' => $doc]); + unset($response['_index']); + unset($response['table']); // assert inserted $this->assertEquals( [ - '_index' => 'products', '_id' => 1001, 'created' => true, 'result' => 'created', From e64e4e5ced6fc466d29fcb4ed61fe2b9b82acbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 31 Oct 2024 16:25:15 +0300 Subject: [PATCH 13/15] test fix --- test/Manticoresearch/Endpoints/InsertTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Manticoresearch/Endpoints/InsertTest.php b/test/Manticoresearch/Endpoints/InsertTest.php index 5db0dc6f..20c1785c 100644 --- a/test/Manticoresearch/Endpoints/InsertTest.php +++ b/test/Manticoresearch/Endpoints/InsertTest.php @@ -34,8 +34,8 @@ public function testInsert() { ], ]; $response = $client->insert(['body' => $doc]); - unset($response['_index']); - unset($response['table']); + unset($response['_index']); + unset($response['table']); // assert inserted $this->assertEquals( From bba2d744f770bfa65c2b0b3acd5c81615ffbc8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 31 Oct 2024 16:37:17 +0300 Subject: [PATCH 14/15] manticoresearch/manticore:5.0.2 --- .github/workflows/ci.yml | 4 ++-- docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83ff15d1..698d7f7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,13 +20,13 @@ jobs: services: manticoresearch-manticore: - image: manticoresearch/manticore:dev + image: manticoresearch/manticore:5.0.2 env: EXTRA: 1 ports: - 9308:9308 manticoresearch-manticore-2: - image: manticoresearch/manticore:dev + image: manticoresearch/manticore:5.0.2 env: EXTRA: 1 ports: diff --git a/docker-compose.yml b/docker-compose.yml index b34654e0..88b2f640 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,13 +25,13 @@ services: - .:/var/www manticoresearch-manticore: - image: manticoresearch/manticore:dev + image: manticoresearch/manticore:5.0.2 expose: - 9306 - 9312 manticoresearch-manticore-2: - image: manticoresearch/manticore:dev + image: manticoresearch/manticore:5.0.2 expose: - 9306 - 9312 From b60d16dce1167ba92bc6d03bcac0ee5a98195ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=A1=D0=BA=D1=83=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 31 Oct 2024 16:45:15 +0300 Subject: [PATCH 15/15] manticoresearch/manticore:dev --- .github/workflows/ci.yml | 4 ++-- docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 698d7f7c..83ff15d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,13 +20,13 @@ jobs: services: manticoresearch-manticore: - image: manticoresearch/manticore:5.0.2 + image: manticoresearch/manticore:dev env: EXTRA: 1 ports: - 9308:9308 manticoresearch-manticore-2: - image: manticoresearch/manticore:5.0.2 + image: manticoresearch/manticore:dev env: EXTRA: 1 ports: diff --git a/docker-compose.yml b/docker-compose.yml index 88b2f640..b34654e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,13 +25,13 @@ services: - .:/var/www manticoresearch-manticore: - image: manticoresearch/manticore:5.0.2 + image: manticoresearch/manticore:dev expose: - 9306 - 9312 manticoresearch-manticore-2: - image: manticoresearch/manticore:5.0.2 + image: manticoresearch/manticore:dev expose: - 9306 - 9312