File tree 4 files changed +12
-8
lines changed
4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to the Solarium library will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ )
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## [ Unreleased]
8
+ ### Changed
9
+ - Spatial component distance type changed from int to float
10
+
7
11
## [ 6.3.2]
8
12
### Added
9
13
- Solarium\Component\ReRankQuery::setOperator()
Original file line number Diff line number Diff line change @@ -52,11 +52,11 @@ public function setField(string $sfield): self
52
52
}
53
53
54
54
/**
55
- * @param int $distance
55
+ * @param float $distance
56
56
*
57
57
* @return self Provides fluent interface
58
58
*/
59
- public function setDistance (int $ distance ): self
59
+ public function setDistance (float $ distance ): self
60
60
{
61
61
$ this ->setOption ('d ' , $ distance );
62
62
@@ -89,9 +89,9 @@ public function getField(): ?string
89
89
/**
90
90
* Get d option.
91
91
*
92
- * @return int |null
92
+ * @return float |null
93
93
*/
94
- public function getDistance (): ?int
94
+ public function getDistance (): ?float
95
95
{
96
96
return $ this ->getOption ('d ' );
97
97
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public function testBuildComponent()
16
16
17
17
$ component = new Component ();
18
18
$ component ->setField ('geo ' );
19
- $ component ->setDistance (50 );
19
+ $ component ->setDistance (50.1415 );
20
20
$ component ->setPoint ('48.2233,16.3161 ' );
21
21
22
22
$ request = $ builder ->buildComponent ($ component , $ request );
@@ -25,7 +25,7 @@ public function testBuildComponent()
25
25
[
26
26
'pt ' => '48.2233,16.3161 ' ,
27
27
'sfield ' => 'geo ' ,
28
- 'd ' => 50 ,
28
+ 'd ' => 50.1415 ,
29
29
],
30
30
$ request ->getParams ()
31
31
);
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function testConfigMode()
22
22
{
23
23
$ options = [
24
24
'sfield ' => 'geo ' ,
25
- 'd ' => 50 ,
25
+ 'd ' => 50.1415 ,
26
26
'pt ' => '48.2233,16.3161 ' ,
27
27
];
28
28
@@ -64,7 +64,7 @@ public function testSetAndGetField()
64
64
65
65
public function testSetAndGetDistance ()
66
66
{
67
- $ value = 5 ;
67
+ $ value = 5.9438 ;
68
68
$ this ->spatial ->setDistance ($ value );
69
69
70
70
$ this ->assertEquals ($ value , $ this ->spatial ->getDistance ());
You can’t perform that action at this time.
0 commit comments