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
5438f5cb
Commit
5438f5cb
authored
Apr 03, 2012
by
Douglas Greenshields
Committed by
Bas de Nooijer
Apr 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed sending of other and include options for facet ranges if they are not set
parent
72ffa056
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php
...arium/Client/RequestBuilder/Select/Component/FacetSet.php
+10
-6
tests/Solarium/Client/RequestBuilder/Select/Component/FacetSetTest.php
...m/Client/RequestBuilder/Select/Component/FacetSetTest.php
+25
-0
No files found.
library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php
View file @
5438f5cb
...
...
@@ -175,14 +175,18 @@ class Solarium_Client_RequestBuilder_Select_Component_FacetSet extends Solarium_
$request
->
addParam
(
"f.
$field
.facet.range.gap"
,
$facet
->
getGap
());
$request
->
addParam
(
"f.
$field
.facet.range.hardend"
,
$facet
->
getHardend
());
if
(
null
!==
$facet
->
getOther
())
{
$other
=
explode
(
','
,
$facet
->
getOther
());
foreach
(
$other
AS
$otherValue
)
{
$request
->
addParam
(
"f.
$field
.facet.range.other"
,
trim
(
$otherValue
));
}
}
if
(
null
!==
$facet
->
getOther
())
{
$include
=
explode
(
','
,
$facet
->
getInclude
());
foreach
(
$include
AS
$includeValue
)
{
$request
->
addParam
(
"f.
$field
.facet.range.include"
,
trim
(
$includeValue
));
}
}
}
}
\ No newline at end of file
tests/Solarium/Client/RequestBuilder/Select/Component/FacetSetTest.php
View file @
5438f5cb
...
...
@@ -111,6 +111,31 @@ class Solarium_Client_RequestBuilder_Select_Component_FacetSetTest extends PHPUn
);
}
public
function
testBuildWithRangeFacetExcludingOptionalParams
()
{
$this
->
_component
->
addFacet
(
new
Solarium_Query_Select_Component_Facet_Range
(
array
(
'key'
=>
'f1'
,
'field'
=>
'price'
,
'start'
=>
'1'
,
'end'
=>
100
,
'gap'
=>
10
,
)
));
$request
=
$this
->
_builder
->
buildComponent
(
$this
->
_component
,
$this
->
_request
);
$this
->
assertEquals
(
null
,
$request
->
getRawData
()
);
$this
->
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'
,
urldecode
(
$request
->
getUri
())
);
}
public
function
testBuildWithFacetsAndGlobalFacetSettings
()
{
$this
->
_component
->
setMissing
(
true
);
...
...
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