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
daa22fce
Commit
daa22fce
authored
Sep 12, 2013
by
Dorian Villet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing everything else.
parent
43c97027
Changes
57
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
133 additions
and
73 deletions
+133
-73
library/Solarium/Core/Client/Adapter/Curl.php
library/Solarium/Core/Client/Adapter/Curl.php
+1
-1
library/Solarium/Core/Client/Adapter/PeclHttp.php
library/Solarium/Core/Client/Adapter/PeclHttp.php
+1
-1
library/Solarium/Core/Query/Helper.php
library/Solarium/Core/Query/Helper.php
+2
-2
library/Solarium/Core/Query/Result/QueryType.php
library/Solarium/Core/Query/Result/QueryType.php
+3
-1
library/Solarium/Plugin/Loadbalancer/Event/Events.php
library/Solarium/Plugin/Loadbalancer/Event/Events.php
+0
-1
library/Solarium/Plugin/ParallelExecution/Event/Events.php
library/Solarium/Plugin/ParallelExecution/Event/Events.php
+0
-1
library/Solarium/QueryType/Analysis/Query/Document.php
library/Solarium/QueryType/Analysis/Query/Document.php
+1
-0
library/Solarium/QueryType/Analysis/Query/Field.php
library/Solarium/QueryType/Analysis/Query/Field.php
+1
-0
library/Solarium/QueryType/Analysis/RequestBuilder/Field.php
library/Solarium/QueryType/Analysis/RequestBuilder/Field.php
+1
-0
library/Solarium/QueryType/Analysis/Result/Document.php
library/Solarium/QueryType/Analysis/Result/Document.php
+1
-0
library/Solarium/QueryType/Extract/Query.php
library/Solarium/QueryType/Extract/Query.php
+2
-1
library/Solarium/QueryType/Extract/RequestBuilder.php
library/Solarium/QueryType/Extract/RequestBuilder.php
+7
-7
library/Solarium/QueryType/MoreLikeThis/Query.php
library/Solarium/QueryType/MoreLikeThis/Query.php
+8
-2
library/Solarium/QueryType/MoreLikeThis/RequestBuilder.php
library/Solarium/QueryType/MoreLikeThis/RequestBuilder.php
+1
-0
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
+1
-0
library/Solarium/QueryType/MoreLikeThis/Result.php
library/Solarium/QueryType/MoreLikeThis/Result.php
+1
-0
library/Solarium/QueryType/Ping/Result.php
library/Solarium/QueryType/Ping/Result.php
+1
-0
library/Solarium/QueryType/RealtimeGet/Query.php
library/Solarium/QueryType/RealtimeGet/Query.php
+1
-0
library/Solarium/QueryType/RealtimeGet/RequestBuilder.php
library/Solarium/QueryType/RealtimeGet/RequestBuilder.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Component.php
...y/Solarium/QueryType/Select/Query/Component/Component.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Debug.php
library/Solarium/QueryType/Select/Query/Component/Debug.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/DistributedSearch.php
...um/QueryType/Select/Query/Component/DistributedSearch.php
+1
-2
library/Solarium/QueryType/Select/Query/Component/Facet/Facet.php
...Solarium/QueryType/Select/Query/Component/Facet/Facet.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Facet/Pivot.php
...Solarium/QueryType/Select/Query/Component/Facet/Pivot.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Facet/Query.php
...Solarium/QueryType/Select/Query/Component/Facet/Query.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Facet/Range.php
...Solarium/QueryType/Select/Query/Component/Facet/Range.php
+9
-2
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
...ry/Solarium/QueryType/Select/Query/Component/FacetSet.php
+2
-1
library/Solarium/QueryType/Select/Query/Component/Highlighting/Field.php
...m/QueryType/Select/Query/Component/Highlighting/Field.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
...Type/Select/Query/Component/Highlighting/Highlighting.php
+4
-3
library/Solarium/QueryType/Select/Query/Component/MoreLikeThis.php
...olarium/QueryType/Select/Query/Component/MoreLikeThis.php
+6
-2
library/Solarium/QueryType/Select/Query/Component/Spellcheck.php
.../Solarium/QueryType/Select/Query/Component/Spellcheck.php
+1
-0
library/Solarium/QueryType/Select/Query/Component/Stats/Field.php
...Solarium/QueryType/Select/Query/Component/Stats/Field.php
+1
-0
library/Solarium/QueryType/Select/Query/Query.php
library/Solarium/QueryType/Select/Query/Query.php
+1
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/ComponentRequestBuilderInterface.php
...estBuilder/Component/ComponentRequestBuilderInterface.php
+1
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/Debug.php
...arium/QueryType/Select/RequestBuilder/Component/Debug.php
+1
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/DisMax.php
...rium/QueryType/Select/RequestBuilder/Component/DisMax.php
+1
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/DistributedSearch.php
...ype/Select/RequestBuilder/Component/DistributedSearch.php
+1
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/Grouping.php
...um/QueryType/Select/RequestBuilder/Component/Grouping.php
+1
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/MoreLikeThis.php
...ueryType/Select/RequestBuilder/Component/MoreLikeThis.php
+5
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/Spellcheck.php
.../QueryType/Select/RequestBuilder/Component/Spellcheck.php
+2
-1
library/Solarium/QueryType/Select/RequestBuilder/RequestBuilder.php
...larium/QueryType/Select/RequestBuilder/RequestBuilder.php
+8
-4
library/Solarium/QueryType/Select/ResponseParser/Component/ComponentParserInterface.php
...ect/ResponseParser/Component/ComponentParserInterface.php
+1
-0
library/Solarium/QueryType/Select/ResponseParser/Component/FacetSet.php
...um/QueryType/Select/ResponseParser/Component/FacetSet.php
+4
-1
library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
...um/QueryType/Select/ResponseParser/Component/Grouping.php
+4
-9
library/Solarium/QueryType/Select/ResponseParser/Component/MoreLikeThis.php
...ueryType/Select/ResponseParser/Component/MoreLikeThis.php
+1
-0
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
.../QueryType/Select/ResponseParser/Component/Spellcheck.php
+5
-8
library/Solarium/QueryType/Select/ResponseParser/Component/Stats.php
...arium/QueryType/Select/ResponseParser/Component/Stats.php
+2
-3
library/Solarium/QueryType/Select/ResponseParser/ResponseParser.php
...larium/QueryType/Select/ResponseParser/ResponseParser.php
+4
-1
library/Solarium/QueryType/Select/Result/Highlighting/Highlighting.php
...ium/QueryType/Select/Result/Highlighting/Highlighting.php
+1
-0
library/Solarium/QueryType/Select/Result/MoreLikeThis/MoreLikeThis.php
...ium/QueryType/Select/Result/MoreLikeThis/MoreLikeThis.php
+1
-0
library/Solarium/QueryType/Select/Result/Result.php
library/Solarium/QueryType/Select/Result/Result.php
+1
-0
library/Solarium/QueryType/Suggester/Query.php
library/Solarium/QueryType/Suggester/Query.php
+1
-0
library/Solarium/QueryType/Suggester/RequestBuilder.php
library/Solarium/QueryType/Suggester/RequestBuilder.php
+1
-0
library/Solarium/QueryType/Suggester/Result/Result.php
library/Solarium/QueryType/Suggester/Result/Result.php
+1
-0
library/Solarium/QueryType/Terms/Query.php
library/Solarium/QueryType/Terms/Query.php
+8
-2
library/Solarium/QueryType/Terms/RequestBuilder.php
library/Solarium/QueryType/Terms/RequestBuilder.php
+1
-0
library/Solarium/QueryType/Update/Query/Query.php
library/Solarium/QueryType/Update/Query/Query.php
+12
-16
No files found.
library/Solarium/Core/Client/Adapter/Curl.php
View file @
daa22fce
...
...
@@ -163,7 +163,7 @@ class Curl extends Configurable implements AdapterInterface
}
if
(
!
empty
(
$authData
[
'username'
])
&&
!
empty
(
$authData
[
'password'
]))
{
curl_setopt
(
$handler
,
CURLOPT_USERPWD
,
$authData
[
'username'
]
.
':'
.
$authData
[
'password'
]
);
curl_setopt
(
$handler
,
CURLOPT_USERPWD
,
$authData
[
'username'
]
.
':'
.
$authData
[
'password'
]);
curl_setopt
(
$handler
,
CURLOPT_HTTPAUTH
,
CURLAUTH_BASIC
);
}
...
...
library/Solarium/Core/Client/Adapter/PeclHttp.php
View file @
daa22fce
...
...
@@ -158,7 +158,7 @@ class PeclHttp extends Configurable implements AdapterInterface
}
if
(
!
empty
(
$authData
[
'username'
])
&&
!
empty
(
$authData
[
'password'
]))
{
$headers
[
'Authorization'
]
=
'Basic '
.
base64_encode
(
$authData
[
'username'
]
.
':'
.
$authData
[
'password'
]
);
$headers
[
'Authorization'
]
=
'Basic '
.
base64_encode
(
$authData
[
'username'
]
.
':'
.
$authData
[
'password'
]);
}
switch
(
$request
->
getMethod
())
{
...
...
library/Solarium/Core/Query/Helper.php
View file @
daa22fce
...
...
@@ -343,7 +343,7 @@ class Helper
public
function
functionCall
(
$name
,
$params
=
array
(),
$dereferenced
=
false
)
{
if
(
$dereferenced
)
{
foreach
(
$params
as
$key
=>
$value
)
{
foreach
(
$params
as
$key
=>
$value
)
{
$this
->
query
->
addParam
(
$key
,
$value
);
}
return
$name
.
'()'
;
...
...
@@ -448,7 +448,7 @@ class Helper
*/
public
function
qparserTerm
(
$field
,
$weight
)
{
return
$this
->
qparser
(
'term'
,
array
(
'f'
=>
$field
))
.
$weight
;
return
$this
->
qparser
(
'term'
,
array
(
'f'
=>
$field
))
.
$weight
;
}
/**
...
...
library/Solarium/Core/Query/Result/QueryType.php
View file @
daa22fce
...
...
@@ -67,7 +67,9 @@ class QueryType extends Result
$responseParser
=
$this
->
query
->
getResponseParser
();
if
(
!
$responseParser
||
!
(
$responseParser
instanceof
ResponseParserInterface
))
{
throw
new
UnexpectedValueException
(
'No responseparser returned by querytype: '
.
$this
->
query
->
getType
());
throw
new
UnexpectedValueException
(
'No responseparser returned by querytype: '
.
$this
->
query
->
getType
()
);
}
$this
->
mapData
(
$responseParser
->
parse
(
$this
));
...
...
library/Solarium/Plugin/Loadbalancer/Event/Events.php
View file @
daa22fce
...
...
@@ -51,5 +51,4 @@ class Events
* @var string
*/
const
ENDPOINT_FAILURE
=
'solarium.loadbalancer.endpointFailure'
;
}
library/Solarium/Plugin/ParallelExecution/Event/Events.php
View file @
daa22fce
...
...
@@ -60,5 +60,4 @@ class Events
* @var string
*/
const
EXECUTE_END
=
'solarium.parallelExecution.executeEnd'
;
}
library/Solarium/QueryType/Analysis/Query/Document.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Analysis\Query
;
use
Solarium\Core\Client\Client
;
use
Solarium\Exception\RuntimeException
;
use
Solarium\QueryType\Analysis\ResponseParser\Document
as
ResponseParser
;
...
...
library/Solarium/QueryType/Analysis/Query/Field.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Analysis\Query
;
use
Solarium\Core\Client\Client
;
use
Solarium\QueryType\Analysis\ResponseParser\Field
as
ResponseParser
;
use
Solarium\QueryType\Analysis\RequestBuilder\Field
as
RequestBuilder
;
...
...
library/Solarium/QueryType/Analysis/RequestBuilder/Field.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Analysis\RequestBuilder
;
use
Solarium\QueryType\Analysis\Query\Field
as
QueryField
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Query\QueryInterface
;
...
...
library/Solarium/QueryType/Analysis/Result/Document.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Analysis\Result
;
use
Solarium\Core\Query\Result\QueryType
as
BaseResult
;
use
Solarium\QueryType\Analysis\Result\ResultList
;
...
...
library/Solarium/QueryType/Extract/Query.php
View file @
daa22fce
...
...
@@ -42,6 +42,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Extract
;
use
Solarium\Core\Query\Query
as
BaseQuery
;
use
Solarium\Core\Client\Client
;
use
Solarium\QueryType\Update\ResponseParser
as
UpdateResponseParser
;
...
...
@@ -303,7 +304,7 @@ class Query extends BaseQuery
*/
public
function
addFieldMappings
(
$mappings
)
{
foreach
(
$mappings
AS
$fromField
=>
$toField
)
{
foreach
(
$mappings
as
$fromField
=>
$toField
)
{
$this
->
addFieldMapping
(
$fromField
,
$toField
);
}
...
...
library/Solarium/QueryType/Extract/RequestBuilder.php
View file @
daa22fce
...
...
@@ -69,14 +69,14 @@ class RequestBuilder extends BaseRequestBuilder
$request
->
setMethod
(
Request
::
METHOD_POST
);
// add common options to request
$request
->
addParam
(
'commit'
,
$query
->
getCommit
());
$request
->
addParam
(
'commit'
,
$query
->
getCommit
());
$request
->
addParam
(
'commitWithin'
,
$query
->
getCommitWithin
());
$request
->
addParam
(
'uprefix'
,
$query
->
getUprefix
());
$request
->
addParam
(
'lowernames'
,
$query
->
getLowernames
());
$request
->
addParam
(
'uprefix'
,
$query
->
getUprefix
());
$request
->
addParam
(
'lowernames'
,
$query
->
getLowernames
());
$request
->
addParam
(
'defaultField'
,
$query
->
getDefaultField
());
foreach
(
$query
->
getFieldMappings
()
AS
$fromField
=>
$toField
)
{
foreach
(
$query
->
getFieldMappings
()
as
$fromField
=>
$toField
)
{
$request
->
addParam
(
'fmap.'
.
$fromField
,
$toField
);
}
...
...
@@ -87,15 +87,15 @@ class RequestBuilder extends BaseRequestBuilder
}
// literal.*
foreach
(
$doc
->
getFields
()
AS
$name
=>
$value
)
{
foreach
(
$doc
->
getFields
()
as
$name
=>
$value
)
{
$value
=
(
array
)
$value
;
foreach
(
$value
AS
$multival
)
{
foreach
(
$value
as
$multival
)
{
$request
->
addParam
(
'literal.'
.
$name
,
$multival
);
}
}
// boost.*
foreach
(
$doc
->
getFieldBoosts
()
AS
$name
=>
$value
)
{
foreach
(
$doc
->
getFieldBoosts
()
as
$name
=>
$value
)
{
$request
->
addParam
(
'boost.'
.
$name
,
$value
);
}
}
...
...
library/Solarium/QueryType/MoreLikeThis/Query.php
View file @
daa22fce
...
...
@@ -203,7 +203,10 @@ class Query extends SelectQuery
public
function
getMltFields
()
{
$value
=
$this
->
getOption
(
'mltfields'
);
if
(
$value
===
null
)
$value
=
array
();
if
(
$value
===
null
)
{
$value
=
array
();
}
return
$value
;
}
...
...
@@ -401,7 +404,10 @@ class Query extends SelectQuery
public
function
getQueryFields
()
{
$value
=
$this
->
getOption
(
'queryfields'
);
if
(
$value
===
null
)
$value
=
array
();
if
(
$value
===
null
)
{
$value
=
array
();
}
return
$value
;
}
}
library/Solarium/QueryType/MoreLikeThis/RequestBuilder.php
View file @
daa22fce
...
...
@@ -40,6 +40,7 @@
* @namespace
*/
namespace
Solarium\QueryType\MoreLikeThis
;
use
Solarium\Core\Client\Request
;
use
Solarium\QueryType\Select\RequestBuilder\RequestBuilder
as
SelectRequestBuilder
;
use
Solarium\Core\Query\QueryInterface
;
...
...
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
View file @
daa22fce
...
...
@@ -38,6 +38,7 @@
* @namespace
*/
namespace
Solarium\QueryType\MoreLikeThis
;
use
Solarium\QueryType\Select\ResponseParser\ResponseParser
as
SelectResponseParser
;
/**
...
...
library/Solarium/QueryType/MoreLikeThis/Result.php
View file @
daa22fce
...
...
@@ -38,6 +38,7 @@
* @namespace
*/
namespace
Solarium\QueryType\MoreLikeThis
;
use
Solarium\QueryType\Select\Result\Document
as
ReadOnlyDocument
;
use
Solarium\QueryType\Select\Result\Result
as
SelectResult
;
use
Solarium\Exception\UnexpectedValueException
;
...
...
library/Solarium/QueryType/Ping/Result.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Ping
;
use
Solarium\Core\Query\Result\Result
as
BaseResult
;
/**
...
...
library/Solarium/QueryType/RealtimeGet/Query.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\RealtimeGet
;
use
Solarium\Core\Query\Query
as
BaseQuery
;
use
Solarium\Core\Client\Client
;
use
Solarium\QueryType\RealtimeGet\RequestBuilder
as
RequestBuilder
;
...
...
library/Solarium/QueryType/RealtimeGet/RequestBuilder.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\RealtimeGet
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Query\RequestBuilder
as
BaseRequestBuilder
;
use
Solarium\Core\Query\QueryInterface
;
...
...
library/Solarium/QueryType/Select/Query/Component/Component.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component
;
use
Solarium\Core\Configurable
;
use
Solarium\Core\Query\Query
;
use
Solarium\QueryType\Select\ResponseParser\Component\ComponentParserInterface
;
...
...
library/Solarium/QueryType/Select/Query/Component/Debug.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\QueryType\Select\RequestBuilder\Component\Debug
as
RequestBuilder
;
use
Solarium\QueryType\Select\ResponseParser\Component\Debug
as
ResponseParser
;
...
...
library/Solarium/QueryType/Select/Query/Component/DistributedSearch.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\QueryType\Select\RequestBuilder\Component\DistributedSearch
as
RequestBuilder
;
...
...
@@ -327,6 +328,4 @@ class DistributedSearch extends Component
{
return
$this
->
collections
;
}
}
library/Solarium/QueryType/Select/Query/Component/Facet/Facet.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Facet
;
use
Solarium\Core\Configurable
;
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Facet/Pivot.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Facet
;
use
Solarium\QueryType\Select\Query\Component\FacetSet
;
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Facet/Query.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Facet
;
use
Solarium\QueryType\Select\Query\Component\FacetSet
;
use
Solarium\Core\Query\Helper
;
...
...
library/Solarium/QueryType/Select/Query/Component/Facet/Range.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Facet
;
use
Solarium\QueryType\Select\Query\Component\FacetSet
;
/**
...
...
@@ -269,7 +270,10 @@ class Range extends Facet
public
function
getOther
()
{
$other
=
$this
->
getOption
(
'other'
);
if
(
$other
===
null
)
$other
=
array
();
if
(
$other
===
null
)
{
$other
=
array
();
}
return
$other
;
}
...
...
@@ -300,7 +304,10 @@ class Range extends Facet
public
function
getInclude
()
{
$include
=
$this
->
getOption
(
'include'
);
if
(
$include
===
null
)
$include
=
array
();
if
(
$include
===
null
)
{
$include
=
array
();
}
return
$include
;
}
}
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\QueryType\Select\RequestBuilder\Component\FacetSet
as
RequestBuilder
;
use
Solarium\QueryType\Select\ResponseParser\Component\FacetSet
as
ResponseParser
;
...
...
@@ -144,7 +145,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
;
}
...
...
library/Solarium/QueryType/Select/Query/Component/Highlighting/Field.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Highlighting
;
use
Solarium\Core\Configurable
;
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Highlighting
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\QueryType\Select\Query\Component\Component
;
use
Solarium\QueryType\Select\RequestBuilder\Component\Highlighting
as
RequestBuilder
;
...
...
@@ -173,7 +174,9 @@ class Highlighting extends Component
// validate field
if
(
$field
->
getName
()
===
null
)
{
throw
new
InvalidArgumentException
(
'To add a highlighting field it needs to have at least a "name" setting'
);
throw
new
InvalidArgumentException
(
'To add a highlighting field it needs to have at least a "name" setting'
);
}
$this
->
fields
[
$field
->
getName
()]
=
$field
;
...
...
@@ -898,6 +901,4 @@ class Highlighting extends Component
{
return
$this
->
getOption
(
'boundaryscannercountry'
);
}
}
library/Solarium/QueryType/Select/Query/Component/MoreLikeThis.php
View file @
daa22fce
...
...
@@ -108,7 +108,9 @@ class MoreLikeThis extends Component
public
function
getFields
()
{
$fields
=
$this
->
getOption
(
'fields'
);
if
(
$fields
==
null
)
$fields
=
array
();
if
(
$fields
==
null
)
{
$fields
=
array
();
}
return
$fields
;
}
...
...
@@ -307,7 +309,9 @@ class MoreLikeThis extends Component
public
function
getQueryFields
()
{
$queryfields
=
$this
->
getOption
(
'queryfields'
);
if
(
$queryfields
==
null
)
$queryfields
=
array
();
if
(
$queryfields
==
null
)
{
$queryfields
=
array
();
}
return
$queryfields
;
}
...
...
library/Solarium/QueryType/Select/Query/Component/Spellcheck.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\QueryType\Select\RequestBuilder\Component\Spellcheck
as
RequestBuilder
;
use
Solarium\QueryType\Select\ResponseParser\Component\Spellcheck
as
ResponseParser
;
...
...
library/Solarium/QueryType/Select/Query/Component/Stats/Field.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query\Component\Stats
;
use
Solarium\Core\Configurable
;
/**
...
...
library/Solarium/QueryType/Select/Query/Query.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Query
;
use
Solarium\Core\Client\Client
;
use
Solarium\Core\Query\Query
as
BaseQuery
;
use
Solarium\QueryType\Select\RequestBuilder\RequestBuilder
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/ComponentRequestBuilderInterface.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Component
;
use
Solarium\Core\Client\Request
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Debug.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Debug
as
DebugComponent
;
use
Solarium\Core\Client\Request
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/DisMax.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Dismax
as
DismaxComponent
;
use
Solarium\Core\Client\Request
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/DistributedSearch.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\DistributedSearch
as
DistributedSearchComponent
;
use
Solarium\Core\Client\Request
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Grouping.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Grouping
as
GroupingComponent
;
use
Solarium\Core\Client\Request
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/MoreLikeThis.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\MoreLikeThis
as
MoreLikeThisComponent
;
use
Solarium\Core\Client\Request
;
...
...
@@ -65,7 +66,10 @@ class MoreLikeThis implements ComponentRequestBuilderInterface
$request
->
addParam
(
'mlt.maxqt'
,
$component
->
getMaximumQueryTerms
());
$request
->
addParam
(
'mlt.maxntp'
,
$component
->
getMaximumNumberOfTokens
());
$request
->
addParam
(
'mlt.boost'
,
$component
->
getBoost
());
$request
->
addParam
(
'mlt.qf'
,
count
(
$component
->
getQueryFields
())
?
implode
(
','
,
$component
->
getQueryFields
())
:
null
);
$request
->
addParam
(
'mlt.qf'
,
count
(
$component
->
getQueryFields
())
?
implode
(
','
,
$component
->
getQueryFields
())
:
null
);
$request
->
addParam
(
'mlt.count'
,
$component
->
getCount
());
return
$request
;
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Spellcheck.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Spellcheck
as
SpellcheckComponent
;
use
Solarium\Core\Client\Request
;
...
...
@@ -71,7 +72,7 @@ class Spellcheck implements ComponentRequestBuilderInterface
$request
->
addParam
(
'spellcheck.collateExtendedResults'
,
$component
->
getCollateExtendedResults
());
$request
->
addParam
(
'spellcheck.accuracy'
,
$component
->
getAccuracy
());
foreach
(
$component
->
getCollateParams
()
as
$param
=>
$value
)
{
foreach
(
$component
->
getCollateParams
()
as
$param
=>
$value
)
{
$request
->
addParam
(
'spellcheck.collateParam.'
.
$param
,
$value
);
}
...
...
library/Solarium/QueryType/Select/RequestBuilder/RequestBuilder.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\RequestBuilder
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Query\RequestBuilder
as
BaseRequestBuilder
;
...
...
@@ -58,10 +59,13 @@ class RequestBuilder extends BaseRequestBuilder
$request
=
parent
::
build
(
$query
);
// add basic params to request
$request
->
addParam
(
'q'
,
$this
->
renderLocalParams
(
$query
->
getQuery
(),
array
(
'tag'
=>
$query
->
getTags
())
));
$request
->
addParam
(
'q'
,
$this
->
renderLocalParams
(
$query
->
getQuery
(),
array
(
'tag'
=>
$query
->
getTags
())
)
);
$request
->
addParam
(
'start'
,
$query
->
getStart
());
$request
->
addParam
(
'rows'
,
$query
->
getRows
());
$request
->
addParam
(
'fl'
,
implode
(
','
,
$query
->
getFields
()));
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/ComponentParserInterface.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\ResponseParser\Component
;
use
Solarium\QueryType\Select\Query\Query
;
interface
ComponentParserInterface
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/FacetSet.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\ResponseParser\Component
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\QueryType\Select\Query\Component\FacetSet
as
QueryFacetSet
;
use
Solarium\QueryType\Select\Query\Component\Facet\Field
as
QueryFacetField
;
...
...
@@ -156,7 +157,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
}
if
(
$query
->
getResponseWriter
()
==
$query
::
WT_JSON
)
{
$data
[
'facet_counts'
][
'facet_fields'
][
$key
]
=
$this
->
convertToKeyValueArray
(
$data
[
'facet_counts'
][
'facet_fields'
][
$key
]);
$data
[
'facet_counts'
][
'facet_fields'
][
$key
]
=
$this
->
convertToKeyValueArray
(
$data
[
'facet_counts'
][
'facet_fields'
][
$key
]
);
}
return
new
ResultFacetField
(
$data
[
'facet_counts'
][
'facet_fields'
][
$key
]);
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\ResponseParser\Component
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\QueryType\Select\Query\Component\Grouping
as
GroupingComponent
;
use
Solarium\QueryType\Select\Result\Grouping\Result
;
...
...
@@ -93,14 +94,10 @@ class Grouping implements ComponentParserInterface
}
}
$valueGroups
[]
=
new
ValueGroup
(
$value
,
$numFound
,
$start
,
$documents
);
$valueGroups
[]
=
new
ValueGroup
(
$value
,
$numFound
,
$start
,
$documents
);
}
$groups
[
$field
]
=
new
FieldGroup
(
$matches
,
$groupCount
,
$valueGroups
);
$groups
[
$field
]
=
new
FieldGroup
(
$matches
,
$groupCount
,
$valueGroups
);
}
}
...
...
@@ -125,9 +122,7 @@ class Grouping implements ComponentParserInterface
}
// create a group result object
$group
=
new
QueryGroup
(
$matches
,
$numFound
,
$start
,
$maxScore
,
$documents
);
$group
=
new
QueryGroup
(
$matches
,
$numFound
,
$start
,
$maxScore
,
$documents
);
$groups
[
$groupQuery
]
=
$group
;
}
}
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/MoreLikeThis.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\ResponseParser\Component
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\QueryType\Select\Query\Component\MoreLikeThis
as
MoreLikeThisComponent
;
use
Solarium\QueryType\Select\Result\MoreLikeThis\Result
;
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
View file @
daa22fce
...
...
@@ -62,8 +62,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
*/
public
function
parse
(
$query
,
$spellcheck
,
$data
)
{
if
(
isset
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
if
(
isset
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
is_array
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
count
(
$data
[
'spellcheck'
][
'suggestions'
])
>
0
)
{
...
...
@@ -121,7 +120,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
if
(
$queryObject
->
getResponseWriter
()
==
$queryObject
::
WT_JSON
)
{
if
(
is_array
(
current
(
$values
)))
{
foreach
(
$values
as
$key
=>
$value
)
{
foreach
(
$values
as
$key
=>
$value
)
{
$values
[
$key
]
=
$this
->
convertToKeyValueArray
(
$value
);
}
}
else
{
...
...
@@ -129,7 +128,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
}
}
foreach
(
$values
as
$collationValue
)
{
foreach
(
$values
as
$collationValue
)
{
$query
=
null
;
$hits
=
null
;
$correctionResult
=
null
;
...
...
@@ -183,7 +182,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$words
=
array
();
if
(
isset
(
$value
[
'suggestion'
])
&&
is_array
(
$value
[
'suggestion'
]))
{
foreach
(
$value
[
'suggestion'
]
as
$suggestion
)
{
foreach
(
$value
[
'suggestion'
]
as
$suggestion
)
{
if
(
is_string
(
$suggestion
))
{
$suggestion
=
array
(
'word'
=>
$suggestion
,
...
...
@@ -194,8 +193,6 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
}
}
return
new
Suggestion
(
$numFound
,
$startOffset
,
$endOffset
,
$originalFrequency
,
$words
);
return
new
Suggestion
(
$numFound
,
$startOffset
,
$endOffset
,
$originalFrequency
,
$words
);
}
}
library/Solarium/QueryType/Select/ResponseParser/Component/Stats.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\ResponseParser\Component
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\QueryType\Select\Query\Component\Stats\Stats
as
StatsComponent
;
use
Solarium\QueryType\Select\Result\Stats\Stats
as
ResultStats
;
...
...
@@ -66,9 +67,7 @@ class Stats implements ComponentParserInterface
if
(
isset
(
$stats
[
'facets'
]))
{
foreach
(
$stats
[
'facets'
]
as
$facetField
=>
$values
)
{
foreach
(
$values
as
$value
=>
$valueStats
)
{
$stats
[
'facets'
][
$facetField
][
$value
]
=
new
ResultStatsFacetValue
(
$value
,
$valueStats
);
$stats
[
'facets'
][
$facetField
][
$value
]
=
new
ResultStatsFacetValue
(
$value
,
$valueStats
);
}
}
}
...
...
library/Solarium/QueryType/Select/ResponseParser/ResponseParser.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\ResponseParser
;
use
Solarium\Core\Query\ResponseParser
as
ResponseParserAbstract
;
use
Solarium\Core\Query\ResponseParserInterface
as
ResponseParserInterface
;
use
Solarium\QueryType\Select\Result\Result
;
...
...
@@ -67,7 +68,9 @@ class ResponseParser extends ResponseParserAbstract implements ResponseParserInt
// create document instances
$documentClass
=
$query
->
getOption
(
'documentclass'
);
$classes
=
class_implements
(
$documentClass
);
if
(
!
in_array
(
'Solarium\QueryType\Select\Result\DocumentInterface'
,
$classes
)
&&
!
in_array
(
'Solarium\QueryType\Update\Query\Document\DocumentInterface'
,
$classes
))
{
if
(
!
in_array
(
'Solarium\QueryType\Select\Result\DocumentInterface'
,
$classes
)
&&
!
in_array
(
'Solarium\QueryType\Update\Query\Document\DocumentInterface'
,
$classes
)
)
{
throw
new
RuntimeException
(
'The result document class must implement a document interface'
);
}
...
...
library/Solarium/QueryType/Select/Result/Highlighting/Highlighting.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Result\Highlighting
;
use
Solarium\QueryType\Select\Result\Highlighting\Result
;
/**
...
...
library/Solarium/QueryType/Select/Result/MoreLikeThis/MoreLikeThis.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Result\MoreLikeThis
;
use
Solarium\QueryType\Select\Result\MoreLikeThis\Result
;
/**
...
...
library/Solarium/QueryType/Select/Result/Result.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Select\Result
;
use
Solarium\QueryType\Select\Query\Query
as
SelectQuery
;
use
Solarium\Core\Query\Result\QueryType
as
BaseResult
;
use
Solarium\QueryType\Select\Result\DocumentInterface
;
...
...
library/Solarium/QueryType/Suggester/Query.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Suggester
;
use
Solarium\Core\Query\Query
as
BaseQuery
;
use
Solarium\Core\Client\Client
;
use
Solarium\QueryType\Suggester\RequestBuilder
;
...
...
library/Solarium/QueryType/Suggester/RequestBuilder.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Suggester
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Query\RequestBuilder
as
BaseRequestBuilder
;
use
Solarium\Core\Query\QueryInterface
;
...
...
library/Solarium/QueryType/Suggester/Result/Result.php
View file @
daa22fce
...
...
@@ -37,6 +37,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Suggester\Result
;
use
Solarium\Core\Query\Result\QueryType
as
BaseResult
;
/**
...
...
library/Solarium/QueryType/Terms/Query.php
View file @
daa22fce
...
...
@@ -120,7 +120,10 @@ class Query extends BaseQuery
public
function
getFields
()
{
$value
=
$this
->
getOption
(
'fields'
);
if
(
$value
===
null
)
$value
=
array
();
if
(
$value
===
null
)
{
$value
=
array
();
}
return
$value
;
}
...
...
@@ -276,7 +279,10 @@ class Query extends BaseQuery
public
function
getRegexFlags
()
{
$value
=
$this
->
getOption
(
'regexflags'
);
if
(
$value
===
null
)
$value
=
array
();
if
(
$value
===
null
)
{
$value
=
array
();
}
return
$value
;
}
...
...
library/Solarium/QueryType/Terms/RequestBuilder.php
View file @
daa22fce
...
...
@@ -40,6 +40,7 @@
* @namespace
*/
namespace
Solarium\QueryType\Terms
;
use
Solarium\Core\Query\RequestBuilder
as
BaseRequestBuilder
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Query\QueryInterface
;
...
...
library/Solarium/QueryType/Update/Query/Query.php
View file @
daa22fce
...
...
@@ -354,8 +354,7 @@ class Query extends BaseQuery
* @param int $commitWithin
* @return self Provides fluent interface
*/
public
function
addDocument
(
DocumentInterface
$document
,
$overwrite
=
null
,
$commitWithin
=
null
)
public
function
addDocument
(
DocumentInterface
$document
,
$overwrite
=
null
,
$commitWithin
=
null
)
{
return
$this
->
addDocuments
(
array
(
$document
),
$overwrite
,
$commitWithin
);
}
...
...
@@ -371,8 +370,7 @@ class Query extends BaseQuery
* @param int $commitWithin
* @return self Provides fluent interface
*/
public
function
addDocuments
(
$documents
,
$overwrite
=
null
,
$commitWithin
=
null
)
public
function
addDocuments
(
$documents
,
$overwrite
=
null
,
$commitWithin
=
null
)
{
$add
=
new
AddCommand
;
...
...
@@ -400,8 +398,7 @@ class Query extends BaseQuery
* @param boolean $expungeDeletes
* @return self Provides fluent interface
*/
public
function
addCommit
(
$softCommit
=
null
,
$waitSearcher
=
null
,
$expungeDeletes
=
null
)
public
function
addCommit
(
$softCommit
=
null
,
$waitSearcher
=
null
,
$expungeDeletes
=
null
)
{
$commit
=
new
CommitCommand
();
...
...
@@ -431,8 +428,7 @@ class Query extends BaseQuery
* @param int $maxSegments
* @return self Provides fluent interface
*/
public
function
addOptimize
(
$softCommit
=
null
,
$waitSearcher
=
null
,
$maxSegments
=
null
)
public
function
addOptimize
(
$softCommit
=
null
,
$waitSearcher
=
null
,
$maxSegments
=
null
)
{
$optimize
=
new
OptimizeCommand
();
...
...
@@ -451,14 +447,14 @@ class Query extends BaseQuery
return
$this
->
add
(
null
,
$optimize
);
}
/**
* Set a custom document class for use in the createDocument method
*
* This class should implement the document interface
*
* @param string $value classname
* @return self Provides fluent interface
*/
/**
* Set a custom document class for use in the createDocument method
*
* This class should implement the document interface
*
* @param string $value classname
* @return self Provides fluent interface
*/
public
function
setDocumentClass
(
$value
)
{
return
$this
->
setOption
(
'documentclass'
,
$value
);
...
...
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