Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
75113025
Commit
75113025
authored
Oct 14, 2016
by
Bas de Nooijer
Committed by
GitHub
Oct 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #431 from vlastv/patch-1
Allows key and exclude for interval facet
parents
6009b94d
2c1b0c14
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
23 deletions
+22
-23
library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php
...um/QueryType/Select/RequestBuilder/Component/FacetSet.php
+2
-3
tests/Solarium/Tests/QueryType/Select/RequestBuilder/Component/FacetSetTest.php
...ueryType/Select/RequestBuilder/Component/FacetSetTest.php
+20
-20
No files found.
library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php
View file @
75113025
...
@@ -246,9 +246,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
...
@@ -246,9 +246,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
$request
->
addParam
(
$request
->
addParam
(
'facet.interval'
,
'facet.interval'
,
$this
->
renderLocalParams
(
$this
->
renderLocalParams
(
$field
$field
,
// key & ex not supported for interval
array
(
'key'
=>
$facet
->
getKey
(),
'ex'
=>
$facet
->
getExcludes
())
//,array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())
)
)
);
);
...
...
tests/Solarium/Tests/QueryType/Select/RequestBuilder/Component/FacetSetTest.php
View file @
75113025
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* this list of conditions and the following disclaimer.
* this list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* this list
of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
...
@@ -69,7 +69,7 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -69,7 +69,7 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
{
{
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
array
(),
array
(),
$request
->
getParams
()
$request
->
getParams
()
);
);
...
@@ -86,12 +86,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -86,12 +86,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.field={!key=f1}owner&facet.query={!key=f2}category:23&facet.query={!key=f4}category:40'
,
'?facet=true&facet.field={!key=f1}owner&facet.query={!key=f2}category:23&facet.query={!key=f4}category:40'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
);
);
...
@@ -114,12 +114,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -114,12 +114,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.range={!key=f1}price&f.price.facet.range.start=1&f.price.facet.range.end=100&f.price.facet.range.gap=10&f.price.facet.mincount=123&f.price.facet.range.other=all&f.price.facet.range.include=outer'
,
'?facet=true&facet.range={!key=f1}price&f.price.facet.range.start=1&f.price.facet.range.end=100&f.price.facet.range.gap=10&f.price.facet.mincount=123&f.price.facet.range.other=all&f.price.facet.range.include=outer'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
);
);
...
@@ -141,12 +141,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -141,12 +141,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.range={!key=f1}price&f.price.facet.range.start=1&f.price.facet.range.end=100'
.
'?facet=true&facet.range={!key=f1}price&f.price.facet.range.start=1&f.price.facet.range.end=100'
.
'&f.price.facet.range.gap=10'
,
'&f.price.facet.range.gap=10'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
...
@@ -165,12 +165,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -165,12 +165,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.missing=true&facet.limit=10&facet.field={!key=f1}owner&facet.query={!key=f2}category:23'
.
'?facet=true&facet.missing=true&facet.limit=10&facet.field={!key=f1}owner&facet.query={!key=f2}category:23'
.
'&facet.query={!key=f4}category:40'
,
'&facet.query={!key=f4}category:40'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
...
@@ -199,12 +199,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -199,12 +199,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.pivot={!key=f1 ex=owner}cat,inStock&facet.pivot.mincount=123'
,
'?facet=true&facet.pivot={!key=f1 ex=owner}cat,inStock&facet.pivot.mincount=123'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
);
);
...
@@ -223,12 +223,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -223,12 +223,12 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.pivot={!stats=piv1}cat,inStock'
,
'?facet=true&facet.pivot={!stats=piv1}cat,inStock'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
);
);
...
@@ -250,18 +250,18 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -250,18 +250,18 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&facet.contains=bar&facet.contains.ignoreCase=false&facet.field={!key=f1}owner&f.owner.facet.contains=foo&f.owner.facet.contains.ignoreCase=true'
,
'?facet=true&facet.contains=bar&facet.contains.ignoreCase=false&facet.field={!key=f1}owner&f.owner.facet.contains=foo&f.owner.facet.contains.ignoreCase=true'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
);
);
}
}
public
function
testBuild
e
WithIntervalFacet
()
public
function
testBuildWithIntervalFacet
()
{
{
$facet
=
new
FacetInterval
(
$facet
=
new
FacetInterval
(
array
(
array
(
...
@@ -275,13 +275,13 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
...
@@ -275,13 +275,13 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$request
=
$this
->
builder
->
buildComponent
(
$this
->
component
,
$this
->
request
);
$this
->
assertEquals
(
static
::
assertEquals
(
null
,
null
,
$request
->
getRawData
()
$request
->
getRawData
()
);
);
$this
->
assertEquals
(
static
::
assertEquals
(
'?facet=true&f..facet.interval.set=int1&f..facet.interval.set={!key="one"}int2'
,
'?facet=true&f
acet.interval={!key=f1}&f
..facet.interval.set=int1&f..facet.interval.set={!key="one"}int2'
,
urldecode
(
$request
->
getUri
())
urldecode
(
$request
->
getUri
())
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment