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
6542c720
Commit
6542c720
authored
Sep 28, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style fixes
parent
d9182d68
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
57 additions
and
58 deletions
+57
-58
library/Solarium/Client.php
library/Solarium/Client.php
+10
-11
library/Solarium/Client/Adapter/PeclHttp.php
library/Solarium/Client/Adapter/PeclHttp.php
+6
-4
library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php
...m/Client/RequestBuilder/Select/Component/Highlighting.php
+1
-1
library/Solarium/Client/RequestBuilder/Select/Component/Spellcheck.php
...ium/Client/RequestBuilder/Select/Component/Spellcheck.php
+13
-15
library/Solarium/Client/ResponseParser/Analysis/Document.php
library/Solarium/Client/ResponseParser/Analysis/Document.php
+1
-1
library/Solarium/Client/ResponseParser/Analysis/Field.php
library/Solarium/Client/ResponseParser/Analysis/Field.php
+4
-4
library/Solarium/Client/ResponseParser/Select/Component/Spellcheck.php
...ium/Client/ResponseParser/Select/Component/Spellcheck.php
+6
-2
library/Solarium/Query/Select.php
library/Solarium/Query/Select.php
+3
-4
library/Solarium/Query/Select/Component/FacetSet.php
library/Solarium/Query/Select/Component/FacetSet.php
+4
-4
library/Solarium/Query/Select/Component/Highlighting.php
library/Solarium/Query/Select/Component/Highlighting.php
+1
-1
library/Solarium/Query/Update.php
library/Solarium/Query/Update.php
+4
-5
library/Solarium/Result/Analysis/Document.php
library/Solarium/Result/Analysis/Document.php
+2
-2
library/Solarium/Result/Analysis/Types.php
library/Solarium/Result/Analysis/Types.php
+2
-4
No files found.
library/Solarium/Client.php
View file @
6542c720
...
...
@@ -392,8 +392,7 @@ class Solarium_Client extends Solarium_Configurable
public
function
removePlugin
(
$plugin
)
{
if
(
is_object
(
$plugin
))
{
foreach
(
$this
->
_plugins
as
$key
=>
$instance
)
{
foreach
(
$this
->
_plugins
as
$key
=>
$instance
)
{
if
(
$instance
===
$plugin
)
{
unset
(
$this
->
_plugins
[
$key
]);
break
;
...
...
library/Solarium/Client/Adapter/PeclHttp.php
View file @
6542c720
...
...
@@ -93,8 +93,9 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
if
(
!
isset
(
$options
[
'headers'
][
'Content-Type'
]))
{
$options
[
'headers'
][
'Content-Type'
]
=
'text/xml; charset=utf-8'
;
}
$httpResponse
=
http_post_data
(
$uri
,
$request
->
getRawData
(),
$options
);
$httpResponse
=
http_post_data
(
$uri
,
$request
->
getRawData
(),
$options
);
}
else
if
(
$method
==
Solarium_Client_Request
::
METHOD_GET
)
{
$httpResponse
=
http_get
(
$uri
,
$options
);
}
else
if
(
$method
==
Solarium_Client_Request
::
METHOD_HEAD
)
{
...
...
@@ -108,8 +109,9 @@ class Solarium_Client_Adapter_PeclHttp extends Solarium_Client_Adapter
if
(
$message
=
http_parse_message
(
$httpResponse
))
{
$data
=
$message
->
body
;
if
(
$firstPositionOfCRLF
=
strpos
(
$httpResponse
,
"
\r\n\r\n
"
))
{
$headersAsString
=
substr
(
$httpResponse
,
0
,
$firstPositionOfCRLF
);
$headersAsString
=
substr
(
$httpResponse
,
0
,
$firstPositionOfCRLF
);
$headers
=
explode
(
"
\n
"
,
$headersAsString
);
}
}
...
...
library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php
View file @
6542c720
...
...
@@ -80,7 +80,7 @@ class Solarium_Client_RequestBuilder_Select_Component_Highlighting
$request
->
addParam
(
'hl.regex.maxAnalyzedChars'
,
$component
->
getRegexMaxAnalyzedChars
());
// set per-field highlighting params
foreach
(
$component
->
getFields
()
as
$field
)
{
foreach
(
$component
->
getFields
()
as
$field
)
{
$this
->
_addFieldParams
(
$field
,
$request
);
}
...
...
library/Solarium/Client/RequestBuilder/Select/Component/Spellcheck.php
View file @
6542c720
...
...
@@ -71,8 +71,6 @@ class Solarium_Client_RequestBuilder_Select_Component_Spellcheck
$request
->
addParam
(
'spellcheck.collateExtendedResults'
,
$component
->
getCollateExtendedResults
());
$request
->
addParam
(
'spellcheck.accuracy'
,
$component
->
getAccuracy
());
return
$request
;
}
}
\ No newline at end of file
library/Solarium/Client/ResponseParser/Analysis/Document.php
View file @
6542c720
...
...
@@ -54,7 +54,7 @@ class Solarium_Client_ResponseParser_Analysis_Document extends Solarium_Client_R
protected
function
_parseAnalysis
(
$data
)
{
$documents
=
array
();
foreach
(
$data
as
$documentKey
=>
$documentData
)
{
foreach
(
$data
as
$documentKey
=>
$documentData
)
{
$fields
=
$this
->
_parseTypes
(
$documentData
);
$documents
[]
=
new
Solarium_Result_Analysis_List
(
$documentKey
,
$fields
);
}
...
...
library/Solarium/Client/ResponseParser/Analysis/Field.php
View file @
6542c720
...
...
@@ -77,7 +77,7 @@ class Solarium_Client_ResponseParser_Analysis_Field extends Solarium_Client_Resp
protected
function
_parseAnalysis
(
$data
)
{
$types
=
array
();
foreach
(
$data
as
$documentKey
=>
$documentData
)
{
foreach
(
$data
as
$documentKey
=>
$documentData
)
{
$fields
=
$this
->
_parseTypes
(
$documentData
);
$types
[]
=
new
Solarium_Result_Analysis_List
(
$documentKey
,
$fields
);
}
...
...
@@ -100,18 +100,18 @@ class Solarium_Client_ResponseParser_Analysis_Field extends Solarium_Client_Resp
foreach
(
$fieldData
as
$typeKey
=>
$typeData
)
{
// fix for extra level for key fields
if
(
count
(
$typeData
)
==
1
){
if
(
count
(
$typeData
)
==
1
){
$typeData
=
current
(
$typeData
);
}
$counter
=
0
;
$classes
=
array
();
while
(
isset
(
$typeData
[
$counter
])
&&
isset
(
$typeData
[
$counter
+
1
]))
{
while
(
isset
(
$typeData
[
$counter
])
&&
isset
(
$typeData
[
$counter
+
1
]))
{
$class
=
$typeData
[
$counter
];
$analysis
=
$typeData
[
$counter
+
1
];
$items
=
array
();
foreach
(
$analysis
AS
$itemData
)
{
foreach
(
$analysis
AS
$itemData
)
{
$items
[]
=
new
Solarium_Result_Analysis_Item
(
$itemData
);
}
...
...
library/Solarium/Client/ResponseParser/Select/Component/Spellcheck.php
View file @
6542c720
...
...
@@ -56,7 +56,11 @@ class Solarium_Client_ResponseParser_Select_Component_Spellcheck
public
function
parse
(
$query
,
$spellcheck
,
$data
)
{
$results
=
array
();
if
(
isset
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
is_array
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
count
(
$data
[
'spellcheck'
][
'suggestions'
])
>
0
)
{
if
(
isset
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
is_array
(
$data
[
'spellcheck'
][
'suggestions'
])
&&
count
(
$data
[
'spellcheck'
][
'suggestions'
])
>
0
)
{
$spellcheckResults
=
$data
[
'spellcheck'
][
'suggestions'
];
...
...
@@ -144,7 +148,7 @@ class Solarium_Client_ResponseParser_Select_Component_Spellcheck
$endOffset
=
(
isset
(
$value
[
'endOffset'
]))
?
$value
[
'endOffset'
]
:
null
;
$originalFrequency
=
(
isset
(
$value
[
'origFreq'
]))
?
$value
[
'origFreq'
]
:
null
;
if
(
is_string
(
$value
[
'suggestion'
][
0
]))
{
if
(
is_string
(
$value
[
'suggestion'
][
0
]))
{
$word
=
$value
[
'suggestion'
][
0
];
$frequency
=
null
;
}
else
{
...
...
library/Solarium/Query/Select.php
View file @
6542c720
...
...
@@ -564,7 +564,7 @@ class Solarium_Query_Select extends Solarium_Query
}
if
(
array_key_exists
(
$key
,
$this
->
_filterQueries
))
{
if
(
$this
->
_filterQueries
[
$key
]
===
$filterQuery
)
{
if
(
$this
->
_filterQueries
[
$key
]
===
$filterQuery
)
{
//double add calls for the same FQ are ignored
//@todo add trigger_error with a notice?
}
else
{
...
...
@@ -765,8 +765,7 @@ class Solarium_Query_Select extends Solarium_Query
public
function
removeComponent
(
$component
)
{
if
(
is_object
(
$component
))
{
foreach
(
$this
->
_components
as
$key
=>
$instance
)
{
foreach
(
$this
->
_components
as
$key
=>
$instance
)
{
if
(
$instance
===
$component
)
{
unset
(
$this
->
_components
[
$key
]);
break
;
...
...
library/Solarium/Query/Select/Component/FacetSet.php
View file @
6542c720
...
...
@@ -267,7 +267,7 @@ class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Com
}
if
(
array_key_exists
(
$key
,
$this
->
_facets
))
{
if
(
$this
->
_facets
[
$key
]
===
$facet
)
{
if
(
$this
->
_facets
[
$key
]
===
$facet
)
{
//double add calls for the same facet are ignored
//@todo add trigger_error with a notice?
}
else
{
...
...
library/Solarium/Query/Select/Component/Highlighting.php
View file @
6542c720
...
...
@@ -99,7 +99,7 @@ class Solarium_Query_Select_Component_Highlighting extends Solarium_Query_Select
{
if
(
isset
(
$this
->
_fields
[
$name
]))
{
return
$this
->
_fields
[
$name
];
}
else
if
(
$autocreate
)
{
}
else
if
(
$autocreate
)
{
$this
->
addField
(
$name
);
return
$this
->
_fields
[
$name
];
}
else
{
...
...
library/Solarium/Query/Update.php
View file @
6542c720
...
...
@@ -207,8 +207,7 @@ class Solarium_Query_Update extends Solarium_Query
public
function
remove
(
$command
)
{
if
(
is_object
(
$command
))
{
foreach
(
$this
->
_commands
as
$key
=>
$instance
)
{
foreach
(
$this
->
_commands
as
$key
=>
$instance
)
{
if
(
$instance
===
$command
)
{
unset
(
$this
->
_commands
[
$key
]);
break
;
...
...
library/Solarium/Result/Analysis/Document.php
View file @
6542c720
...
...
@@ -145,7 +145,7 @@ class Solarium_Result_Analysis_Document extends Solarium_Result_QueryType
{
$this
->
_parseResponse
();
if
(
isset
(
$this
->
_items
[
$key
]))
{
if
(
isset
(
$this
->
_items
[
$key
]))
{
return
$this
->
_items
[
$key
];
}
else
{
return
null
;
...
...
library/Solarium/Result/Analysis/Types.php
View file @
6542c720
...
...
@@ -52,8 +52,7 @@ class Solarium_Result_Analysis_Types extends Solarium_Result_Analysis_List
*/
public
function
getIndexAnalysis
()
{
foreach
(
$this
->
_items
AS
$item
)
{
foreach
(
$this
->
_items
AS
$item
)
{
if
(
$item
->
getName
()
==
'index'
)
{
return
$item
;
}
...
...
@@ -69,8 +68,7 @@ class Solarium_Result_Analysis_Types extends Solarium_Result_Analysis_List
*/
public
function
getQueryAnalysis
()
{
foreach
(
$this
->
_items
AS
$item
)
{
foreach
(
$this
->
_items
AS
$item
)
{
if
(
$item
->
getName
()
==
'query'
)
{
return
$item
;
}
...
...
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