Skip to content

Commit 0acdb28

Browse files
authored
Merge pull request #456 from solariumphp/develop
Creating new release
2 parents 91fe408 + e800d95 commit 0acdb28

File tree

21 files changed

+494
-97
lines changed

21 files changed

+494
-97
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## 3.7.0 - 2016-10-28
4+
5+
- added: support for nested documents in update query
6+
- added: spatial component for select query
7+
- added: support for keys and excludes in interval facet
8+
- added: support for grouping using a function (group.func)
9+
- bugfix: spellcheck collation parsing for Solr 5+
10+
- improvement: lots of fixes in documentation markup
11+
- added: included suggestion in composer file for a query builder library
312

413
## 3.6.0 - 2016-05-03
514

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"zendframework/zendframework1": "~1.12",
2222
"satooshi/php-coveralls": "~1.0"
2323
},
24+
"suggest": {
25+
"minimalcode/search": "Query builder compatible with Solarium, allows simplified solr-query handling"
26+
},
2427
"extra": {
2528
"branch-alias": {
2629
"dev-develop": "3.3.x-dev"

docs/customizing-solarium.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ By combining these options you can achieve almost any type of customization with
9797

9898
Solarium uses a separate library (included using Composer) for events. For more info on the Event Dispatcher take a look at [http://symfony.com/doc/2.0/components/event\_dispatcher/introduction.html the docs](http://symfony.com/doc/2.0/components/event_dispatcher/introduction.html_the_docs)
9999

100-
This example shows all available events and how to use the events to create a very basic debugger: ```php
100+
This example shows all available events and how to use the events to create a very basic debugger:
101+
```php
101102
<?php
102103
require(__DIR__.'/init.php');
103104
use Solarium\Core\Event\Events;
@@ -230,7 +231,8 @@ htmlFooter();
230231

231232
```
232233

233-
The second example shows how to replace the built-in select querytype with a custom implementation: ```php
234+
The second example shows how to replace the built-in select querytype with a custom implementation:
235+
```php
234236
<?php
235237
require(__DIR__.'/init.php');
236238
use Solarium\Client;
@@ -297,4 +299,4 @@ Extending Solarium classes
297299
You can extend any class in Solarium, there is no use of 'private' or 'final'. However, Solarium does have several built-in class mappings for factory methods. Most important are the querytype mapping in Solarium\\Client and the component mapping in Solarium\\QueryType\\Select\\Query\\Query. In some cases you might need to alter this mappings for your classes to be used.
298300
Other than that, there are no special issues to be expected. You can extend Solarium classes like any other PHP class.
299301

300-
If your use case can be solved using plugins that is probably the safest choice, as by extending classes you gain access to non-public methods in the API. These are subject to change in future releases, where the public API is not (except for major releases).
302+
If your use case can be solved using plugins that is probably the safest choice, as by extending classes you gain access to non-public methods in the API. These are subject to change in future releases, where the public API is not (except for major releases).

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See [<https://packagist.org>](https://packagist.org) for other packages.
2828
```json
2929
{
3030
"require": {
31-
"solarium/solarium": "2.4.0"
31+
"solarium/solarium": "3.6.0"
3232
}
3333
}
3434
```

docs/queries/select-query/building-a-select-query/components/grouping-component.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Options
2424
Examples
2525
--------
2626

27-
Grouping by field: ```php
27+
Grouping by field:
28+
29+
```php
2830
<?php
2931

3032
require(__DIR__.'/init.php');
@@ -82,7 +84,9 @@ htmlFooter();
8284

8385
```
8486

85-
Grouping by query: ```php
87+
Grouping by query:
88+
89+
```php
8690
<?php
8791

8892
require(__DIR__.'/init.php');

library/Solarium/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Client extends CoreClient
7272
*
7373
* @var string
7474
*/
75-
const VERSION = '3.6.0';
75+
const VERSION = '3.7.0';
7676

7777
/**
7878
* Check for an exact version.

library/Solarium/QueryType/Select/Query/Component/Facet/AbstractFacet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected function init()
180180
break;
181181
case 'exclude':
182182
if (!is_array($value)) {
183-
$value = array($value);
183+
$value = explode(',', $value);
184184
}
185185
$this->setExcludes($value);
186186
unset($this->options['exclude']);
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?php
2+
3+
namespace Solarium\QueryType\Select\Query\Component;
4+
5+
use Solarium\QueryType\Select\Query\Query as SelectQuery;
6+
use Solarium\QueryType\Select\RequestBuilder\Component\Spatial as RequestBuilder;
7+
8+
/**
9+
* Spatial component.
10+
*
11+
* @link https://cwiki.apache.org/confluence/display/solr/Spatial+Search
12+
*/
13+
class Spatial extends AbstractComponent
14+
{
15+
/**
16+
* Get component type.
17+
*
18+
* @return string
19+
*/
20+
public function getType()
21+
{
22+
return SelectQuery::COMPONENT_SPATIAL;
23+
}
24+
25+
/**
26+
* Get a requestbuilder for this query.
27+
*
28+
* @return RequestBuilder
29+
*/
30+
public function getRequestBuilder()
31+
{
32+
return new RequestBuilder();
33+
}
34+
35+
/**
36+
* This component has no response parser...
37+
*/
38+
public function getResponseParser()
39+
{
40+
return;
41+
}
42+
43+
/**
44+
* @param string $sfield
45+
*/
46+
public function setField($sfield)
47+
{
48+
$this->setOption('sfield', $sfield);
49+
}
50+
51+
/**
52+
* @param int $distance
53+
*/
54+
public function setDistance($distance)
55+
{
56+
$this->setOption('d', $distance);
57+
}
58+
59+
/**
60+
* @param string $point
61+
*/
62+
public function setPoint($point)
63+
{
64+
$this->setOption('pt', $point);
65+
}
66+
67+
/**
68+
* Get sfield option.
69+
*
70+
* @return string|null
71+
*/
72+
public function getField()
73+
{
74+
return $this->getOption('sfield');
75+
}
76+
77+
/**
78+
* Get d option.
79+
*
80+
* @return int|null
81+
*/
82+
public function getDistance()
83+
{
84+
return $this->getOption('d');
85+
}
86+
87+
/**
88+
* Get pt option.
89+
*
90+
* @return int|null
91+
*/
92+
public function getPoint()
93+
{
94+
return $this->getOption('pt');
95+
}
96+
}

library/Solarium/QueryType/Select/Query/Query.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ class Query extends BaseQuery
127127
*/
128128
const COMPONENT_DEBUG = 'debug';
129129

130+
/**
131+
* Query component spatial.
132+
*/
133+
const COMPONENT_SPATIAL = 'spatial';
134+
130135
/**
131136
* Default options.
132137
*
@@ -166,6 +171,7 @@ class Query extends BaseQuery
166171
self::COMPONENT_DISTRIBUTEDSEARCH => 'Solarium\QueryType\Select\Query\Component\DistributedSearch',
167172
self::COMPONENT_STATS => 'Solarium\QueryType\Select\Query\Component\Stats\Stats',
168173
self::COMPONENT_DEBUG => 'Solarium\QueryType\Select\Query\Component\Debug',
174+
self::COMPONENT_SPATIAL => 'Solarium\QueryType\Select\Query\Component\Spatial',
169175
);
170176

171177
/**
@@ -1057,6 +1063,18 @@ public function setTags($tags)
10571063
return $this->addTags($tags);
10581064
}
10591065

1066+
/**
1067+
* Get a Spatial component instance.
1068+
*
1069+
* This is a convenience method that maps presets to getComponent
1070+
*
1071+
* @return \Solarium\QueryType\Select\Query\Component\Spatial
1072+
*/
1073+
public function getSpatial()
1074+
{
1075+
return $this->getComponent(self::COMPONENT_SPATIAL, true);
1076+
}
1077+
10601078
/**
10611079
* Initialize options.
10621080
*
@@ -1090,7 +1108,7 @@ protected function init()
10901108
break;
10911109
case 'tag':
10921110
if (!is_array($value)) {
1093-
$value = array($value);
1111+
$value = explode(',', $value);
10941112
}
10951113
$this->addTags($value);
10961114
break;

library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ public function addFacetInterval($request, $facet)
246246
$request->addParam(
247247
'facet.interval',
248248
$this->renderLocalParams(
249-
$field
250-
// key & ex not supported for interval
251-
//,array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())
249+
$field,
250+
array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())
252251
)
253252
);
254253

0 commit comments

Comments
 (0)