Skip to content

Commit d9183d9

Browse files
authored
Merge pull request #64 from mirko-bukilic/release/2.0.x
Removed 'query' wrapper in QueryStringOperator for es2
2 parents bc46b05 + dbaeea4 commit d9183d9

3 files changed

Lines changed: 18 additions & 23 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ TITLE = [data-mapper]
22

33
unit-tests:
44
@/bin/echo "${TITLE} unit test suite started..." \
5-
&& XDEBUG_MODE=off php5.6 ./vendor/bin/phpunit -c tests/unit/phpunit.xml --coverage-html tests/unit/coverage
5+
&& XDEBUG_MODE=off php ./vendor/bin/phpunit -c tests/unit/phpunit.xml --coverage-html tests/unit/coverage
66

77
integration-tests:
88
@/bin/echo "${TITLE} starting virtual machine ..." \

src/Engine/Elasticsearch/Operators/QueryStringOperator.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ public function __construct($name, SingleValue $value)
1818
public function format()
1919
{
2020
return [
21-
QueryConnector::NAME_QUERY_STRING_QUERY =>
21+
QueryConnector::NAME_QUERY_STRING =>
2222
[
23-
QueryConnector::NAME_QUERY_STRING =>
24-
[
25-
QueryConnector::NAME_QUERY_STRING_QUERY => $this->value->getValue(),
26-
QueryConnector::ANALYZE_WILDCARD => true,
27-
],
23+
QueryConnector::NAME_QUERY_STRING_QUERY => $this->value->getValue(),
24+
QueryConnector::ANALYZE_WILDCARD => true,
2825
],
2926
];
3027
}

tests/unit/src/Engine/Elasticsearch/ElasticsearchComparisonFormatterTest.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function setUp(): void
2929
public function tearDown(): void
3030
{
3131
$this->comparisonFormatter = null;
32-
$this->operatorMock = null;
32+
$this->operatorMock = null;
3333
}
3434

3535
public function testEqual()
@@ -51,8 +51,8 @@ public function testEqualCI()
5151
['match' => [
5252
'email' => [
5353
'query' => 'text@example.com',
54-
'type' => 'phrase'
55-
]
54+
'type' => 'phrase',
55+
],
5656
]],
5757
$this->comparisonFormatter->format('email', $this->operatorMock, new SingleValue('text@example.com'))
5858
);
@@ -69,8 +69,8 @@ public function testEqualCIEsVersion7()
6969
$this->assertEquals(
7070
['match' => [
7171
'email' => [
72-
'query' => 'text@example.com'
73-
]
72+
'query' => 'text@example.com',
73+
],
7474
]],
7575
$comparisonFormatter->format('email', $this->operatorMock, new SingleValue('text@example.com'))
7676
);
@@ -157,10 +157,10 @@ public function testTimeFromInMinutes()
157157
$this->assertEquals([
158158
'range' => [
159159
'online' => [
160-
'gt' => strtotime("-15 minute", time()),
160+
'gt' => strtotime("-15 minute", time()),
161161
'format' => 'epoch_second',
162-
]
163-
]
162+
],
163+
],
164164
], $this->comparisonFormatter->format('online', $this->operatorMock, new SingleValue(15)));
165165
}
166166

@@ -214,12 +214,10 @@ public function testQueryString()
214214

215215
$this->assertEquals(
216216
[
217-
'query' => [
218-
'query_string' => [
219-
'query' => 'username: *test* OR email: *test*',
220-
'analyze_wildcard' => true,
221-
],
222-
]
217+
'query_string' => [
218+
'query' => 'username: *test* OR email: *test*',
219+
'analyze_wildcard' => true,
220+
],
223221
],
224222
$this->comparisonFormatter
225223
->format('', $this->operatorMock, new SingleValue('username: *test* OR email: *test*'))
@@ -237,8 +235,8 @@ public function testQueryStringVersion7()
237235
$this->assertEquals(
238236
[
239237
'query_string' => [
240-
'query' => 'username: *test* OR email: *test*'
241-
]
238+
'query' => 'username: *test* OR email: *test*',
239+
],
242240
],
243241
$comparisonFormatter->format('', $this->operatorMock, new SingleValue('username: *test* OR email: *test*'))
244242
);

0 commit comments

Comments
 (0)