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
b6698661
Commit
b6698661
authored
Apr 15, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed the configuration mode for select queries
parent
44ef2299
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
library/Solarium/Query/Select.php
library/Solarium/Query/Select.php
+10
-2
library/Solarium/Query/Select/Facet.php
library/Solarium/Query/Select/Facet.php
+4
-0
library/Solarium/Query/Select/FilterQuery.php
library/Solarium/Query/Select/FilterQuery.php
+4
-0
No files found.
library/Solarium/Query/Select.php
View file @
b6698661
...
@@ -453,7 +453,11 @@ class Solarium_Query_Select extends Solarium_Query
...
@@ -453,7 +453,11 @@ class Solarium_Query_Select extends Solarium_Query
*/
*/
public
function
addFilterQueries
(
array
$filterQueries
)
public
function
addFilterQueries
(
array
$filterQueries
)
{
{
foreach
(
$filterQueries
AS
$filterQuery
)
{
foreach
(
$filterQueries
AS
$key
=>
$filterQuery
)
{
// in case of a config array: add key to config
if
(
is_array
(
$filterQuery
))
$filterQuery
[
'key'
]
=
$key
;
$this
->
addFilterQuery
(
$filterQuery
);
$this
->
addFilterQuery
(
$filterQuery
);
}
}
...
@@ -560,7 +564,11 @@ class Solarium_Query_Select extends Solarium_Query
...
@@ -560,7 +564,11 @@ class Solarium_Query_Select extends Solarium_Query
*/
*/
public
function
addFacets
(
array
$facets
)
public
function
addFacets
(
array
$facets
)
{
{
foreach
(
$facets
AS
$facet
)
{
foreach
(
$facets
AS
$key
=>
$facet
)
{
// in case of a config array: add key to config
if
(
is_array
(
$facet
))
$facet
[
'key'
]
=
$key
;
$this
->
addFacet
(
$facet
);
$this
->
addFacet
(
$facet
);
}
}
...
...
library/Solarium/Query/Select/Facet.php
View file @
b6698661
...
@@ -76,7 +76,11 @@ abstract class Solarium_Query_Select_Facet extends Solarium_Configurable
...
@@ -76,7 +76,11 @@ abstract class Solarium_Query_Select_Facet extends Solarium_Configurable
{
{
foreach
(
$this
->
_options
AS
$name
=>
$value
)
{
foreach
(
$this
->
_options
AS
$name
=>
$value
)
{
switch
(
$name
)
{
switch
(
$name
)
{
case
'key'
:
$this
->
setKey
(
$value
);
break
;
case
'exclude'
:
case
'exclude'
:
if
(
!
is_array
(
$value
))
$value
=
array
(
$value
);
$this
->
setExcludes
(
$value
);
$this
->
setExcludes
(
$value
);
break
;
break
;
}
}
...
...
library/Solarium/Query/Select/FilterQuery.php
View file @
b6698661
...
@@ -70,8 +70,12 @@ class Solarium_Query_Select_FilterQuery extends Solarium_Configurable
...
@@ -70,8 +70,12 @@ class Solarium_Query_Select_FilterQuery extends Solarium_Configurable
foreach
(
$this
->
_options
AS
$name
=>
$value
)
{
foreach
(
$this
->
_options
AS
$name
=>
$value
)
{
switch
(
$name
)
{
switch
(
$name
)
{
case
'tag'
:
case
'tag'
:
if
(
!
is_array
(
$value
))
$value
=
array
(
$value
);
$this
->
addTags
(
$value
);
$this
->
addTags
(
$value
);
break
;
break
;
case
'key'
:
$this
->
setKey
(
$value
);
break
;
case
'query'
:
case
'query'
:
$this
->
setQuery
(
$value
);
$this
->
setQuery
(
$value
);
break
;
break
;
...
...
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