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
c37e459b
Commit
c37e459b
authored
Mar 24, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various code standard fixes
parent
404be18c
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
86 additions
and
89 deletions
+86
-89
library/Solarium/Core/Client/Client.php
library/Solarium/Core/Client/Client.php
+8
-8
library/Solarium/Core/Client/Endpoint.php
library/Solarium/Core/Client/Endpoint.php
+1
-1
library/Solarium/Core/Client/Request.php
library/Solarium/Core/Client/Request.php
+1
-1
library/Solarium/Core/Client/Response.php
library/Solarium/Core/Client/Response.php
+1
-1
library/Solarium/Core/Query/RequestBuilder.php
library/Solarium/Core/Query/RequestBuilder.php
+1
-1
library/Solarium/Core/Query/Result/QueryType.php
library/Solarium/Core/Query/Result/QueryType.php
+1
-1
library/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
...ary/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
+2
-2
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
+7
-7
library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
...ary/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
+1
-1
library/Solarium/Plugin/ParallelExecution.php
library/Solarium/Plugin/ParallelExecution.php
+6
-4
library/Solarium/Plugin/PrefetchIterator.php
library/Solarium/Plugin/PrefetchIterator.php
+1
-1
library/Solarium/Query/Analysis/RequestBuilder/Document.php
library/Solarium/Query/Analysis/RequestBuilder/Document.php
+3
-3
library/Solarium/Query/Analysis/Result/Types.php
library/Solarium/Query/Analysis/Result/Types.php
+2
-2
library/Solarium/Query/MoreLikeThis/Result.php
library/Solarium/Query/MoreLikeThis/Result.php
+1
-1
library/Solarium/Query/Select/Query/Component/DistributedSearch.php
...larium/Query/Select/Query/Component/DistributedSearch.php
+1
-1
library/Solarium/Query/Select/Query/Component/Facet/Facet.php
...ary/Solarium/Query/Select/Query/Component/Facet/Facet.php
+2
-2
library/Solarium/Query/Select/Query/Component/Facet/MultiQuery.php
...olarium/Query/Select/Query/Component/Facet/MultiQuery.php
+5
-5
library/Solarium/Query/Select/Query/Component/Facet/Range.php
...ary/Solarium/Query/Select/Query/Component/Facet/Range.php
+1
-1
library/Solarium/Query/Select/Query/Component/FacetSet.php
library/Solarium/Query/Select/Query/Component/FacetSet.php
+2
-2
library/Solarium/Query/Select/Query/Component/Grouping.php
library/Solarium/Query/Select/Query/Component/Grouping.php
+2
-3
library/Solarium/Query/Select/Query/Component/Highlighting/Highlighting.php
...uery/Select/Query/Component/Highlighting/Highlighting.php
+2
-2
library/Solarium/Query/Select/Query/Component/Stats/Field.php
...ary/Solarium/Query/Select/Query/Component/Stats/Field.php
+2
-2
library/Solarium/Query/Select/Query/Component/Stats/Stats.php
...ary/Solarium/Query/Select/Query/Component/Stats/Stats.php
+3
-3
library/Solarium/Query/Select/Query/FilterQuery.php
library/Solarium/Query/Select/Query/FilterQuery.php
+2
-2
library/Solarium/Query/Select/Query/Query.php
library/Solarium/Query/Select/Query/Query.php
+5
-5
library/Solarium/Query/Select/RequestBuilder/Component/FacetSet.php
...larium/Query/Select/RequestBuilder/Component/FacetSet.php
+4
-4
library/Solarium/Query/Select/RequestBuilder/RequestBuilder.php
...y/Solarium/Query/Select/RequestBuilder/RequestBuilder.php
+2
-2
library/Solarium/Query/Select/ResponseParser/Component/FacetSet.php
...larium/Query/Select/ResponseParser/Component/FacetSet.php
+3
-3
library/Solarium/Query/Select/ResponseParser/Component/Highlighting.php
...um/Query/Select/ResponseParser/Component/Highlighting.php
+1
-1
library/Solarium/Query/Select/ResponseParser/Component/MoreLikeThis.php
...um/Query/Select/ResponseParser/Component/MoreLikeThis.php
+2
-2
library/Solarium/Query/Select/ResponseParser/Component/Stats.php
.../Solarium/Query/Select/ResponseParser/Component/Stats.php
+1
-1
library/Solarium/Query/Select/ResponseParser/ResponseParser.php
...y/Solarium/Query/Select/ResponseParser/ResponseParser.php
+1
-1
library/Solarium/Query/Select/Result/Debug/Document.php
library/Solarium/Query/Select/Result/Debug/Document.php
+2
-1
library/Solarium/Query/Select/Result/Result.php
library/Solarium/Query/Select/Result/Result.php
+1
-1
library/Solarium/Query/Update/Query/Command/Add.php
library/Solarium/Query/Update/Query/Command/Add.php
+0
-1
library/Solarium/Query/Update/Query/Command/Commit.php
library/Solarium/Query/Update/Query/Command/Commit.php
+0
-1
library/Solarium/Query/Update/Query/Command/Delete.php
library/Solarium/Query/Update/Query/Command/Delete.php
+0
-1
library/Solarium/Query/Update/Query/Command/Optimize.php
library/Solarium/Query/Update/Query/Command/Optimize.php
+0
-1
library/Solarium/Query/Update/Query/Command/Rollback.php
library/Solarium/Query/Update/Query/Command/Rollback.php
+0
-1
library/Solarium/Query/Update/RequestBuilder.php
library/Solarium/Query/Update/RequestBuilder.php
+6
-6
No files found.
library/Solarium/Core/Client/Client.php
View file @
c37e459b
...
...
@@ -192,7 +192,7 @@ class Client extends Configurable
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'endpoint'
:
$this
->
addEndpoints
(
$value
);
...
...
@@ -281,7 +281,7 @@ class Client extends Configurable
*/
public
function
addEndpoints
(
array
$endpoints
)
{
foreach
(
$endpoints
AS
$key
=>
$endpoint
)
{
foreach
(
$endpoints
as
$key
=>
$endpoint
)
{
// in case of a config array: add key to config
if
(
is_array
(
$endpoint
)
&&
!
isset
(
$endpoint
[
'key'
]))
{
...
...
@@ -415,13 +415,13 @@ class Client extends Configurable
if
(
is_string
(
$adapter
))
{
$this
->
adapter
=
null
;
return
$this
->
setOption
(
'adapter'
,
$adapter
);
}
else
if
(
$adapter
instanceof
AdapterInterface
){
}
else
if
(
$adapter
instanceof
AdapterInterface
)
{
// forward options
$adapter
->
setOptions
(
$this
->
options
);
// overwrite existing adapter
$this
->
adapter
=
$adapter
;
return
$this
;
}
else
{
}
else
{
throw
new
Exception
(
'Invalid adapter input for setAdapter'
);
}
}
...
...
@@ -445,7 +445,7 @@ class Client extends Configurable
$adapter
=
new
$adapterClass
;
// check interface
if
(
!
(
$adapter
instanceof
AdapterInterface
))
{
if
(
!
(
$adapter
instanceof
AdapterInterface
))
{
throw
new
Exception
(
'An adapter must implement the AdapterInterface'
);
}
...
...
@@ -666,7 +666,7 @@ class Client extends Configurable
*/
protected
function
callPlugins
(
$event
,
$params
,
$resultOverride
=
false
)
{
foreach
(
$this
->
pluginInstances
AS
$plugin
)
{
foreach
(
$this
->
pluginInstances
as
$plugin
)
{
if
(
method_exists
(
$plugin
,
$event
))
{
$result
=
call_user_func_array
(
array
(
$plugin
,
$event
),
$params
);
...
...
@@ -686,7 +686,7 @@ class Client extends Configurable
public
function
createRequest
(
QueryInterface
$query
)
{
$pluginResult
=
$this
->
callPlugins
(
'preCreateRequest'
,
array
(
$query
),
true
);
if
(
$pluginResult
!==
null
)
{
if
(
$pluginResult
!==
null
)
{
return
$pluginResult
;
}
...
...
@@ -934,7 +934,7 @@ class Client extends Configurable
$type
=
strtolower
(
$type
);
$pluginResult
=
$this
->
callPlugins
(
'preCreateQuery'
,
array
(
$type
,
$options
),
true
);
if
(
$pluginResult
!==
null
)
{
if
(
$pluginResult
!==
null
)
{
return
$pluginResult
;
}
...
...
library/Solarium/Core/Client/Endpoint.php
View file @
c37e459b
...
...
@@ -69,7 +69,7 @@ class Endpoint extends Configurable
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'path'
:
$this
->
setPath
(
$value
);
...
...
library/Solarium/Core/Client/Request.php
View file @
c37e459b
...
...
@@ -96,7 +96,7 @@ class Request extends Configurable
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'rawdata'
:
$this
->
setRawData
(
$value
);
...
...
library/Solarium/Core/Client/Response.php
View file @
c37e459b
...
...
@@ -138,7 +138,7 @@ class Response
// get the status header
$statusHeader
=
null
;
foreach
(
$headers
AS
$header
)
{
foreach
(
$headers
as
$header
)
{
if
(
substr
(
$header
,
0
,
4
)
==
'HTTP'
)
{
$statusHeader
=
$header
;
break
;
...
...
library/Solarium/Core/Query/RequestBuilder.php
View file @
c37e459b
...
...
@@ -76,7 +76,7 @@ abstract class RequestBuilder implements RequestBuilderInterface
public
function
renderLocalParams
(
$value
,
$localParams
=
array
())
{
$params
=
''
;
foreach
(
$localParams
AS
$paramName
=>
$paramValue
)
{
foreach
(
$localParams
as
$paramName
=>
$paramValue
)
{
if
(
empty
(
$paramValue
))
{
continue
;
}
...
...
library/Solarium/Core/Query/Result/QueryType.php
View file @
c37e459b
...
...
@@ -83,7 +83,7 @@ class QueryType extends Result
*/
protected
function
mapData
(
$mapData
)
{
foreach
(
$mapData
AS
$key
=>
$data
)
{
foreach
(
$mapData
as
$key
=>
$data
)
{
$this
->
$key
=
$data
;
}
}
...
...
library/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
View file @
c37e459b
...
...
@@ -65,7 +65,7 @@ class CustomizeRequest extends Plugin
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'customization'
:
$this
->
addCustomizations
(
$value
);
...
...
@@ -146,7 +146,7 @@ class CustomizeRequest extends Plugin
*/
public
function
addCustomizations
(
array
$customizations
)
{
foreach
(
$customizations
AS
$key
=>
$customization
)
{
foreach
(
$customizations
as
$key
=>
$customization
)
{
// in case of a config array: add key to config
if
(
is_array
(
$customization
)
&&
!
isset
(
$customization
[
'key'
]))
{
...
...
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
View file @
c37e459b
...
...
@@ -145,7 +145,7 @@ class Loadbalancer extends Plugin
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'endpoint'
:
$this
->
setEndpoints
(
$value
);
...
...
@@ -208,7 +208,7 @@ class Loadbalancer extends Plugin
*/
public
function
addEndpoint
(
$endpoint
,
$weight
=
1
)
{
if
(
!
is_string
(
$endpoint
))
{
if
(
!
is_string
(
$endpoint
))
{
$endpoint
=
$endpoint
->
getKey
();
}
...
...
@@ -232,7 +232,7 @@ class Loadbalancer extends Plugin
*/
public
function
addEndpoints
(
array
$endpoints
)
{
foreach
(
$endpoints
AS
$endpoint
=>
$weight
)
{
foreach
(
$endpoints
as
$endpoint
=>
$weight
)
{
$this
->
addEndpoint
(
$endpoint
,
$weight
);
}
...
...
@@ -267,7 +267,7 @@ class Loadbalancer extends Plugin
*/
public
function
removeEndpoint
(
$endpoint
)
{
if
(
!
is_string
(
$endpoint
))
{
if
(
!
is_string
(
$endpoint
))
{
$endpoint
=
$endpoint
->
getKey
();
}
...
...
@@ -305,7 +305,7 @@ class Loadbalancer extends Plugin
*/
public
function
setForcedEndpointForNextQuery
(
$endpoint
)
{
if
(
!
is_string
(
$endpoint
))
{
if
(
!
is_string
(
$endpoint
))
{
$endpoint
=
$endpoint
->
getKey
();
}
...
...
@@ -377,7 +377,7 @@ class Loadbalancer extends Plugin
*/
public
function
addBlockedQueryTypes
(
$types
)
{
foreach
(
$types
AS
$type
)
{
foreach
(
$types
as
$type
)
{
$this
->
addBlockedQueryType
(
$type
);
}
}
...
...
@@ -472,7 +472,7 @@ class Loadbalancer extends Plugin
$endpoint
=
$this
->
getRandomEndpoint
();
try
{
return
$adapter
->
execute
(
$request
,
$endpoint
);
}
catch
(
HttpException
$e
)
{
}
catch
(
HttpException
$e
)
{
// ignore HTTP errors and try again
// but do issue an event for things like logging
$this
->
client
->
triggerEvent
(
'LoadbalancerEndpointFail'
,
array
(
$endpoint
->
getOptions
(),
$e
));
...
...
library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
View file @
c37e459b
...
...
@@ -76,7 +76,7 @@ class WeightedRandomChoice
public
function
__construct
(
$choices
)
{
$i
=
0
;
foreach
(
$choices
AS
$key
=>
$weight
)
{
foreach
(
$choices
as
$key
=>
$weight
)
{
if
(
$weight
<=
0
)
{
throw
new
Exception
(
'Weight must be greater than zero'
);
}
...
...
library/Solarium/Plugin/ParallelExecution.php
View file @
c37e459b
...
...
@@ -50,9 +50,9 @@ use Solarium\Core\Query\Query;
*
* While query execution is parallel, the results only become available as soon as all requests have finished. So the
* time of the slowest query will be the effective execution time for all queries.
*
* @codeCoverageIgnoreStart
*/
// @codeCoverageIgnoreStart
class
ParallelExecution
extends
Plugin
{
...
...
@@ -173,7 +173,7 @@ class ParallelExecution extends Plugin
curl_multi_remove_handle
(
$multiHandle
,
$handle
);
$response
=
$adapter
->
getResponse
(
$handle
,
curl_multi_getcontent
(
$handle
));
$results
[
$key
]
=
$this
->
client
->
createResult
(
$this
->
queries
[
$key
][
'query'
],
$response
);
}
catch
(
HttpException
$e
)
{
}
catch
(
HttpException
$e
)
{
$results
[
$key
]
=
$e
;
}
...
...
@@ -184,5 +184,7 @@ class ParallelExecution extends Plugin
return
$results
;
}
// @codeCoverageIgnoreEnd
/**
* @codeCoverageIgnoreEnd
*/
}
library/Solarium/Plugin/PrefetchIterator.php
View file @
c37e459b
...
...
@@ -180,7 +180,7 @@ class PrefetchIterator extends Plugin implements \Iterator, \Countable
*
* @return int
*/
function
key
()
public
function
key
()
{
return
$this
->
position
;
}
...
...
library/Solarium/Query/Analysis/RequestBuilder/Document.php
View file @
c37e459b
...
...
@@ -72,12 +72,12 @@ class Document extends BaseRequestBuilder
{
$xml
=
'<docs>'
;
foreach
(
$query
->
getDocuments
()
AS
$doc
)
{
foreach
(
$query
->
getDocuments
()
as
$doc
)
{
$xml
.=
'<doc>'
;
foreach
(
$doc
->
getFields
()
AS
$name
=>
$value
)
{
foreach
(
$doc
->
getFields
()
as
$name
=>
$value
)
{
if
(
is_array
(
$value
))
{
foreach
(
$value
AS
$multival
)
{
foreach
(
$value
as
$multival
)
{
$xml
.=
$this
->
buildFieldXml
(
$name
,
$multival
);
}
}
else
{
...
...
library/Solarium/Query/Analysis/Result/Types.php
View file @
c37e459b
...
...
@@ -51,7 +51,7 @@ class Types extends ResultList
*/
public
function
getIndexAnalysis
()
{
foreach
(
$this
->
items
AS
$item
)
{
foreach
(
$this
->
items
as
$item
)
{
if
(
$item
->
getName
()
==
'index'
)
{
return
$item
;
}
...
...
@@ -67,7 +67,7 @@ class Types extends ResultList
*/
public
function
getQueryAnalysis
()
{
foreach
(
$this
->
items
AS
$item
)
{
foreach
(
$this
->
items
as
$item
)
{
if
(
$item
->
getName
()
==
'query'
)
{
return
$item
;
}
...
...
library/Solarium/Query/MoreLikeThis/Result.php
View file @
c37e459b
...
...
@@ -54,7 +54,7 @@ use Solarium\Query\Select\Result\Result as SelectResult;
* count($result);
*
* // iterate over fetched mlt docs
* foreach ($result
AS
$doc) {
* foreach ($result
as
$doc) {
* ....
* }
* </code>
...
...
library/Solarium/Query/Select/Query/Component/DistributedSearch.php
View file @
c37e459b
...
...
@@ -95,7 +95,7 @@ class DistributedSearch extends Component
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'shards'
:
$this
->
setShards
(
$value
);
...
...
library/Solarium/Query/Select/Query/Component/Facet/Facet.php
View file @
c37e459b
...
...
@@ -69,7 +69,7 @@ abstract class Facet extends Configurable
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'key'
:
$this
->
setKey
(
$value
);
...
...
@@ -126,7 +126,7 @@ abstract class Facet extends Configurable
*/
public
function
addExcludes
(
array
$excludes
)
{
foreach
(
$excludes
AS
$exclude
)
{
foreach
(
$excludes
as
$exclude
)
{
$this
->
addExclude
(
$exclude
);
}
...
...
library/Solarium/Query/Select/Query/Component/Facet/MultiQuery.php
View file @
c37e459b
...
...
@@ -68,7 +68,7 @@ class MultiQuery extends Facet
{
parent
::
init
();
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'query'
:
if
(
!
is_array
(
$value
))
{
...
...
@@ -154,7 +154,7 @@ class MultiQuery extends Facet
*/
public
function
addQueries
(
array
$facetQueries
)
{
foreach
(
$facetQueries
AS
$key
=>
$facetQuery
)
{
foreach
(
$facetQueries
as
$key
=>
$facetQuery
)
{
// in case of a config array: add key to config
if
(
is_array
(
$facetQuery
)
&&
!
isset
(
$facetQuery
[
'key'
]))
{
...
...
@@ -252,7 +252,7 @@ class MultiQuery extends Facet
*/
public
function
addExclude
(
$tag
)
{
foreach
(
$this
->
facetQueries
AS
$facetQuery
)
{
foreach
(
$this
->
facetQueries
as
$facetQuery
)
{
$facetQuery
->
addExclude
(
$tag
);
}
...
...
@@ -273,7 +273,7 @@ class MultiQuery extends Facet
*/
public
function
removeExclude
(
$exclude
)
{
foreach
(
$this
->
facetQueries
AS
$facetQuery
)
{
foreach
(
$this
->
facetQueries
as
$facetQuery
)
{
$facetQuery
->
removeExclude
(
$exclude
);
}
...
...
@@ -293,7 +293,7 @@ class MultiQuery extends Facet
*/
public
function
clearExcludes
()
{
foreach
(
$this
->
facetQueries
AS
$facetQuery
)
{
foreach
(
$this
->
facetQueries
as
$facetQuery
)
{
$facetQuery
->
clearExcludes
();
}
...
...
library/Solarium/Query/Select/Query/Component/Facet/Range.php
View file @
c37e459b
...
...
@@ -109,7 +109,7 @@ class Range extends Facet
{
parent
::
init
();
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'include'
:
$this
->
setInclude
(
$value
);
...
...
library/Solarium/Query/Select/Query/Component/FacetSet.php
View file @
c37e459b
...
...
@@ -137,7 +137,7 @@ class FacetSet extends Component
protected
function
init
()
{
if
(
isset
(
$this
->
options
[
'facet'
]))
{
foreach
(
$this
->
options
[
'facet'
]
AS
$key
=>
$config
)
{
foreach
(
$this
->
options
[
'facet'
]
as
$key
=>
$config
)
{
if
(
!
isset
(
$config
[
'key'
]))
{
$config
[
'key'
]
=
$key
;
}
...
...
@@ -311,7 +311,7 @@ class FacetSet extends Component
*/
public
function
addFacets
(
array
$facets
)
{
foreach
(
$facets
AS
$key
=>
$facet
)
{
foreach
(
$facets
as
$key
=>
$facet
)
{
// in case of a config array: add key to config
if
(
is_array
(
$facet
)
&&
!
isset
(
$facet
[
'key'
]))
{
...
...
library/Solarium/Query/Select/Query/Component/Grouping.php
View file @
c37e459b
...
...
@@ -47,8 +47,7 @@ use Solarium\Query\Select\ResponseParser\Component\Grouping as ResponseParser;
* Also known as Result Grouping or Field Collapsing.
* See the Solr wiki for more info about this functionality
*
* @link http://wiki.apache.org/solr/FieldCollapsing
*
* @link http://wiki.apache.org/solr/FieldCollapsing
* @since 2.1.0
*/
class
Grouping
extends
Component
...
...
@@ -125,7 +124,7 @@ class Grouping extends Component
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'queries'
:
$this
->
setQueries
(
$value
);
...
...
library/Solarium/Query/Select/Query/Component/Highlighting/Highlighting.php
View file @
c37e459b
...
...
@@ -106,7 +106,7 @@ class Highlighting extends Component
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'field'
:
$this
->
addFields
(
$value
);
...
...
@@ -173,7 +173,7 @@ class Highlighting extends Component
$fields
=
array_map
(
'trim'
,
$fields
);
}
foreach
(
$fields
AS
$key
=>
$field
)
{
foreach
(
$fields
as
$key
=>
$field
)
{
// in case of a config array without key: add key to config
if
(
is_array
(
$field
)
&&
!
isset
(
$field
[
'name'
]))
{
...
...
library/Solarium/Query/Select/Query/Component/Stats/Field.php
View file @
c37e459b
...
...
@@ -62,7 +62,7 @@ class Field extends Configurable
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'facet'
:
$this
->
setFacets
(
$value
);
...
...
@@ -119,7 +119,7 @@ class Field extends Configurable
$facets
=
array_map
(
'trim'
,
$facets
);
}
foreach
(
$facets
AS
$facet
)
{
foreach
(
$facets
as
$facet
)
{
$this
->
addFacet
(
$facet
);
}
...
...
library/Solarium/Query/Select/Query/Component/Stats/Stats.php
View file @
c37e459b
...
...
@@ -105,7 +105,7 @@ class Stats extends Component
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'field'
:
$this
->
setFields
(
$value
);
...
...
@@ -186,7 +186,7 @@ class Stats extends Component
*/
public
function
addFields
(
array
$fields
)
{
foreach
(
$fields
AS
$key
=>
$field
)
{
foreach
(
$fields
as
$key
=>
$field
)
{
// in case of a config array: add key to config
if
(
is_array
(
$field
)
&&
!
isset
(
$field
[
'key'
]))
{
...
...
@@ -296,7 +296,7 @@ class Stats extends Component
$facets
=
array_map
(
'trim'
,
$facets
);
}
foreach
(
$facets
AS
$facet
)
{
foreach
(
$facets
as
$facet
)
{
$this
->
addFacet
(
$facet
);
}
...
...
library/Solarium/Query/Select/Query/FilterQuery.php
View file @
c37e459b
...
...
@@ -69,7 +69,7 @@ class FilterQuery extends Configurable
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'tag'
:
if
(
!
is_array
(
$value
))
{
...
...
@@ -158,7 +158,7 @@ class FilterQuery extends Configurable
*/
public
function
addTags
(
$tags
)
{
foreach
(
$tags
AS
$tag
)
{
foreach
(
$tags
as
$tag
)
{
$this
->
addTag
(
$tag
);
}
return
$this
;
...
...
library/Solarium/Query/Select/Query/Query.php
View file @
c37e459b
...
...
@@ -218,7 +218,7 @@ class Query extends BaseQuery
*/
protected
function
init
()
{
foreach
(
$this
->
options
AS
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
case
'query'
:
$this
->
setQuery
(
$value
);
...
...
@@ -433,7 +433,7 @@ class Query extends BaseQuery
$fields
=
array_map
(
'trim'
,
$fields
);
}
foreach
(
$fields
AS
$field
)
{
foreach
(
$fields
as
$field
)
{
$this
->
addField
(
$field
);
}
...
...
@@ -516,7 +516,7 @@ class Query extends BaseQuery
*/
public
function
addSorts
(
array
$sorts
)
{
foreach
(
$sorts
AS
$sort
=>
$order
)
{
foreach
(
$sorts
as
$sort
=>
$order
)
{
$this
->
addSort
(
$sort
,
$order
);
}
...
...
@@ -644,7 +644,7 @@ class Query extends BaseQuery
*/
public
function
addFilterQueries
(
array
$filterQueries
)
{
foreach
(
$filterQueries
AS
$key
=>
$filterQuery
)
{
foreach
(
$filterQueries
as
$key
=>
$filterQuery
)
{
// in case of a config array: add key to config
if
(
is_array
(
$filterQuery
)
&&
!
isset
(
$filterQuery
[
'key'
]))
{
...
...
@@ -841,7 +841,7 @@ class Query extends BaseQuery
*/
protected
function
createComponents
(
$configs
)
{
foreach
(
$configs
AS
$type
=>
$config
)
{
foreach
(
$configs
as
$type
=>
$config
)
{
$this
->
getComponent
(
$type
,
true
,
$config
);
}
}
...
...
library/Solarium/Query/Select/RequestBuilder/Component/FacetSet.php
View file @
c37e459b
...
...
@@ -75,7 +75,7 @@ class FacetSet extends RequestBuilder
$request
->
addParam
(
'facet.mincount'
,
$component
->
getMinCount
());
$request
->
addParam
(
'facet.limit'
,
$component
->
getLimit
());
foreach
(
$facets
AS
$facet
)
{
foreach
(
$facets
as
$facet
)
{
switch
(
$facet
->
getType
())
{
case
FacetsetComponent
::
FACET_FIELD
:
...
...
@@ -154,7 +154,7 @@ class FacetSet extends RequestBuilder
*/
public
function
addFacetMultiQuery
(
$request
,
$facet
)
{
foreach
(
$facet
->
getQueries
()
AS
$facetQuery
)
{
foreach
(
$facet
->
getQueries
()
as
$facetQuery
)
{
$this
->
addFacetQuery
(
$request
,
$facetQuery
);
}
}
...
...
@@ -185,14 +185,14 @@ class FacetSet extends RequestBuilder
if
(
$facet
->
getInclude
()
!==
null
)
{
$other
=
explode
(
','
,
$facet
->
getOther
());
foreach
(
$other
AS
$otherValue
)
{
foreach
(
$other
as
$otherValue
)
{
$request
->
addParam
(
"f.
$field
.facet.range.other"
,
trim
(
$otherValue
));
}
}
if
(
$facet
->
getInclude
()
!==
null
)
{
$include
=
explode
(
','
,
$facet
->
getInclude
());
foreach
(
$include
AS
$includeValue
)
{
foreach
(
$include
as
$includeValue
)
{
$request
->
addParam
(
"f.
$field
.facet.range.include"
,
trim
(
$includeValue
));
}
}
...
...
library/Solarium/Query/Select/RequestBuilder/RequestBuilder.php
View file @
c37e459b
...
...
@@ -68,7 +68,7 @@ class RequestBuilder extends BaseRequestBuilder
// add sort fields to request
$sort
=
array
();
foreach
(
$query
->
getSorts
()
AS
$field
=>
$order
)
{
foreach
(
$query
->
getSorts
()
as
$field
=>
$order
)
{
$sort
[]
=
$field
.
' '
.
$order
;
}
if
(
count
(
$sort
)
!==
0
)
{
...
...
@@ -78,7 +78,7 @@ class RequestBuilder extends BaseRequestBuilder
// add filterqueries to request
$filterQueries
=
$query
->
getFilterQueries
();
if
(
count
(
$filterQueries
)
!==
0
)
{
foreach
(
$filterQueries
AS
$filterQuery
)
{
foreach
(
$filterQueries
as
$filterQuery
)
{
$fq
=
$this
->
renderLocalParams
(
$filterQuery
->
getQuery
(),
array
(
'tag'
=>
$filterQuery
->
getTags
())
...
...
library/Solarium/Query/Select/ResponseParser/Component/FacetSet.php
View file @
c37e459b
...
...
@@ -61,7 +61,7 @@ class FacetSet
public
function
parse
(
$query
,
$facetSet
,
$data
)
{
$facets
=
array
();
foreach
(
$facetSet
->
getFacets
()
AS
$key
=>
$facet
)
{
foreach
(
$facetSet
->
getFacets
()
as
$key
=>
$facet
)
{
switch
(
$facet
->
getType
())
{
case
QueryFacetSet
::
FACET_FIELD
:
$result
=
$this
->
facetField
(
$facet
,
$data
);
...
...
@@ -116,7 +116,7 @@ class FacetSet
);
$facetValues
=
array
();
foreach
(
$values
AS
$value
)
{
foreach
(
$values
as
$value
)
{
$facetValues
[
$value
[
0
]]
=
$value
[
1
];
}
...
...
@@ -151,7 +151,7 @@ class FacetSet
protected
function
facetMultiQuery
(
$facet
,
$data
)
{
$values
=
array
();
foreach
(
$facet
->
getQueries
()
AS
$query
)
{
foreach
(
$facet
->
getQueries
()
as
$query
)
{
$key
=
$query
->
getKey
();
if
(
isset
(
$data
[
'facet_counts'
][
'facet_queries'
][
$key
]))
{
$count
=
$data
[
'facet_counts'
][
'facet_queries'
][
$key
];
...
...
library/Solarium/Query/Select/ResponseParser/Component/Highlighting.php
View file @
c37e459b
...
...
@@ -61,7 +61,7 @@ class Highlighting
if
(
isset
(
$data
[
'highlighting'
]))
{
$highlightResults
=
$data
[
'highlighting'
];
foreach
(
$highlightResults
AS
$key
=>
$result
)
{
foreach
(
$highlightResults
as
$key
=>
$result
)
{
$results
[
$key
]
=
new
HighlightingResult\Result
(
$result
);
...
...
library/Solarium/Query/Select/ResponseParser/Component/MoreLikeThis.php
View file @
c37e459b
...
...
@@ -63,11 +63,11 @@ class MoreLikeThis
$documentClass
=
$query
->
getOption
(
'documentclass'
);
$searchResults
=
$data
[
'moreLikeThis'
];
foreach
(
$searchResults
AS
$key
=>
$result
)
{
foreach
(
$searchResults
as
$key
=>
$result
)
{
// create document instances
$docs
=
array
();
foreach
(
$result
[
'docs'
]
AS
$fields
)
{
foreach
(
$result
[
'docs'
]
as
$fields
)
{
$docs
[]
=
new
$documentClass
(
$fields
);
}
...
...
library/Solarium/Query/Select/ResponseParser/Component/Stats.php
View file @
c37e459b
...
...
@@ -63,7 +63,7 @@ class Stats
if
(
isset
(
$data
[
'stats'
][
'stats_fields'
]))
{
$statResults
=
$data
[
'stats'
][
'stats_fields'
];
foreach
(
$statResults
AS
$field
=>
$stats
)
{
foreach
(
$statResults
as
$field
=>
$stats
)
{
if
(
isset
(
$stats
[
'facets'
]))
{
foreach
(
$stats
[
'facets'
]
as
$facetField
=>
$values
)
{
foreach
(
$values
as
$value
=>
$valueStats
)
{
...
...
library/Solarium/Query/Select/ResponseParser/ResponseParser.php
View file @
c37e459b
...
...
@@ -61,7 +61,7 @@ class ResponseParser implements ResponseParserInterface
$documentClass
=
$query
->
getOption
(
'documentclass'
);
$documents
=
array
();
if
(
isset
(
$data
[
'response'
][
'docs'
]))
{
foreach
(
$data
[
'response'
][
'docs'
]
AS
$doc
)
{
foreach
(
$data
[
'response'
][
'docs'
]
as
$doc
)
{
$fields
=
(
array
)
$doc
;
$documents
[]
=
new
$documentClass
(
$fields
);
}
...
...
library/Solarium/Query/Select/Result/Debug/Document.php
View file @
c37e459b
...
...
@@ -41,7 +41,8 @@ namespace Solarium\Query\Select\Result\Debug;
/**
* Select component debug document result
*/
class
Document
extends
Detail
implements
\IteratorAggregate
,
\Countable
{
class
Document
extends
Detail
implements
\IteratorAggregate
,
\Countable
{
/**
* Key
...
...
library/Solarium/Query/Select/Result/Result.php
View file @
c37e459b
...
...
@@ -55,7 +55,7 @@ use Solarium\Core\Query\Result\QueryType as BaseResult;
* $result->getFacet('category');
*
* // iterate over fetched docs
* foreach ($result
AS
$doc) {
* foreach ($result
as
$doc) {
* ....
* }
* </code>
...
...
library/Solarium/Query/Update/Query/Command/Add.php
View file @
c37e459b
...
...
@@ -42,7 +42,6 @@ use Solarium\Query\Update\Query\Query as UpdateQuery;
/**
* Update query add command
*
* For details about the Solr options see:
* @link http://wiki.apache.org/solr/UpdateXmlMessages#add.2BAC8-update
*/
class
Add
extends
Command
...
...
library/Solarium/Query/Update/Query/Command/Commit.php
View file @
c37e459b
...
...
@@ -42,7 +42,6 @@ use Solarium\Query\Update\Query\Query as UpdateQuery;
/**
* Update query commit command
*
* For details about the Solr options see:
* @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22commit.22_and_.22optimize.22
*/
class
Commit
extends
Command
...
...
library/Solarium/Query/Update/Query/Command/Delete.php
View file @
c37e459b
...
...
@@ -42,7 +42,6 @@ use Solarium\Query\Update\Query\Query as UpdateQuery;
/**
* Update query delete command
*
* For details about the Solr options see:
* @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22delete.22_by_ID_and_by_Query
*/
class
Delete
extends
Command
...
...
library/Solarium/Query/Update/Query/Command/Optimize.php
View file @
c37e459b
...
...
@@ -42,7 +42,6 @@ use Solarium\Query\Update\Query\Query as UpdateQuery;
/**
* Update query optimize command
*
* For details about the Solr options see:
* @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22commit.22_and_.22optimize.22
*/
class
Optimize
extends
Command
...
...
library/Solarium/Query/Update/Query/Command/Rollback.php
View file @
c37e459b
...
...
@@ -42,7 +42,6 @@ use Solarium\Query\Update\Query\Query as UpdateQuery;
/**
* Update query rollback command
*
* For details see:
* @link http://wiki.apache.org/solr/UpdateXmlMessages#A.22rollback.22
*/
class
Rollback
extends
Command
...
...
library/Solarium/Query/Update/RequestBuilder.php
View file @
c37e459b
...
...
@@ -77,7 +77,7 @@ class RequestBuilder extends BaseRequestBuilder
public
function
getRawData
(
$query
)
{
$xml
=
'<update>'
;
foreach
(
$query
->
getCommands
()
AS
$command
)
{
foreach
(
$query
->
getCommands
()
as
$command
)
{
switch
(
$command
->
getType
())
{
case
UpdateQuery
::
COMMAND_ADD
:
$xml
.=
$this
->
buildAddXml
(
$command
);
...
...
@@ -117,15 +117,15 @@ class RequestBuilder extends BaseRequestBuilder
$xml
.=
$this
->
attrib
(
'commitWithin'
,
$command
->
getCommitWithin
());
$xml
.=
'>'
;
foreach
(
$command
->
getDocuments
()
AS
$doc
)
{
foreach
(
$command
->
getDocuments
()
as
$doc
)
{
$xml
.=
'<doc'
;
$xml
.=
$this
->
attrib
(
'boost'
,
$doc
->
getBoost
());
$xml
.=
'>'
;
foreach
(
$doc
->
getFields
()
AS
$name
=>
$value
)
{
foreach
(
$doc
->
getFields
()
as
$name
=>
$value
)
{
$boost
=
$doc
->
getFieldBoost
(
$name
);
if
(
is_array
(
$value
))
{
foreach
(
$value
AS
$multival
)
{
foreach
(
$value
as
$multival
)
{
$xml
.=
$this
->
buildFieldXml
(
$name
,
$boost
,
$multival
);
}
}
else
{
...
...
@@ -170,11 +170,11 @@ class RequestBuilder extends BaseRequestBuilder
public
function
buildDeleteXml
(
$command
)
{
$xml
=
'<delete>'
;
foreach
(
$command
->
getIds
()
AS
$id
)
{
foreach
(
$command
->
getIds
()
as
$id
)
{
$xml
.=
'<id>'
.
htmlspecialchars
(
$id
,
ENT_NOQUOTES
,
'UTF-8'
)
.
'</id>'
;
}
foreach
(
$command
->
getQueries
()
AS
$query
)
{
foreach
(
$command
->
getQueries
()
as
$query
)
{
$xml
.=
'<query>'
.
htmlspecialchars
(
$query
,
ENT_NOQUOTES
,
'UTF-8'
)
.
'</query>'
;
}
...
...
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