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
4158c2e0
Commit
4158c2e0
authored
Mar 23, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed examples
parent
98cac95f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
23 additions
and
23 deletions
+23
-23
examples/2.1.5.9-spellcheck.php
examples/2.1.5.9-spellcheck.php
+0
-1
examples/2.4.1-analysis-document.php
examples/2.4.1-analysis-document.php
+1
-1
examples/4.3-extending-usage.php
examples/4.3-extending-usage.php
+2
-2
examples/5.3.1-plugin-event-hooks.php
examples/5.3.1-plugin-event-hooks.php
+10
-10
examples/5.3.2-plugin-solarium-presets.php
examples/5.3.2-plugin-solarium-presets.php
+4
-4
examples/6.1.1-zend-http-adapter.php
examples/6.1.1-zend-http-adapter.php
+1
-1
examples/6.1.2-pecl-http-adapter.php
examples/6.1.2-pecl-http-adapter.php
+1
-1
examples/6.1.3-curl-adapter.php
examples/6.1.3-curl-adapter.php
+1
-1
examples/7.5-plugin-bufferedadd.php
examples/7.5-plugin-bufferedadd.php
+2
-1
library/Solarium/Plugin/ParallelExecution.php
library/Solarium/Plugin/ParallelExecution.php
+1
-1
No files found.
examples/2.1.5.9-spellcheck.php
View file @
4158c2e0
...
@@ -22,7 +22,6 @@ $spellcheck->setCollateExtendedResults(true);
...
@@ -22,7 +22,6 @@ $spellcheck->setCollateExtendedResults(true);
$resultset
=
$client
->
select
(
$query
);
$resultset
=
$client
->
select
(
$query
);
$spellcheckResult
=
$resultset
->
getSpellcheck
();
$spellcheckResult
=
$resultset
->
getSpellcheck
();
echo
'<h1>Correctly spelled?</h1>'
;
echo
'<h1>Correctly spelled?</h1>'
;
if
(
$spellcheckResult
->
getCorrectlySpelled
())
{
if
(
$spellcheckResult
->
getCorrectlySpelled
())
{
echo
'yes'
;
echo
'yes'
;
...
...
examples/2.4.1-analysis-document.php
View file @
4158c2e0
...
@@ -12,7 +12,7 @@ $query = $client->createAnalysisDocument();
...
@@ -12,7 +12,7 @@ $query = $client->createAnalysisDocument();
$query
->
setShowMatch
(
true
);
$query
->
setShowMatch
(
true
);
$query
->
setQuery
(
'ipod'
);
$query
->
setQuery
(
'ipod'
);
$doc
=
new
Solarium\
Document\ReadWrite
(
$doc
=
new
Solarium\
Query\Update\Query\Document
(
array
(
array
(
'id'
=>
'MA147LL'
,
'id'
=>
'MA147LL'
,
'name'
=>
'Apple 60 GB iPod with Video Playback Black'
,
'name'
=>
'Apple 60 GB iPod with Video Playback Black'
,
...
...
examples/4.3-extending-usage.php
View file @
4158c2e0
...
@@ -10,9 +10,9 @@ htmlHeader();
...
@@ -10,9 +10,9 @@ htmlHeader();
// This makes it possible to create 'query inheritance' like in this example
// This makes it possible to create 'query inheritance' like in this example
class
ProductQuery
extends
Select
{
class
ProductQuery
extends
Select
{
protected
function
_
init
()
protected
function
init
()
{
{
parent
::
_
init
();
parent
::
init
();
// basic params
// basic params
$this
->
setQuery
(
'*:*'
);
$this
->
setQuery
(
'*:*'
);
...
...
examples/5.3.1-plugin-event-hooks.php
View file @
4158c2e0
...
@@ -9,7 +9,7 @@ class basicDebug extends Solarium\Core\Plugin
...
@@ -9,7 +9,7 @@ class basicDebug extends Solarium\Core\Plugin
protected
$start
;
protected
$start
;
protected
$output
=
array
();
protected
$output
=
array
();
public
function
initPlugin
()
public
function
initPlugin
(
$client
,
$options
)
{
{
$this
->
start
=
microtime
(
true
);
$this
->
start
=
microtime
(
true
);
}
}
...
@@ -26,12 +26,12 @@ class basicDebug extends Solarium\Core\Plugin
...
@@ -26,12 +26,12 @@ class basicDebug extends Solarium\Core\Plugin
echo
implode
(
'<br/>'
,
$this
->
output
);
echo
implode
(
'<br/>'
,
$this
->
output
);
}
}
public
function
preCreateRequest
()
public
function
preCreateRequest
(
$query
)
{
{
$this
->
timer
(
'preCreateRequest'
);
$this
->
timer
(
'preCreateRequest'
);
}
}
public
function
postCreateRequest
()
public
function
postCreateRequest
(
$query
,
$request
)
{
{
$this
->
timer
(
'postCreateRequest'
);
$this
->
timer
(
'postCreateRequest'
);
}
}
...
@@ -48,37 +48,37 @@ class basicDebug extends Solarium\Core\Plugin
...
@@ -48,37 +48,37 @@ class basicDebug extends Solarium\Core\Plugin
$this
->
output
[]
=
'Request URI: '
.
$request
->
getUri
();
$this
->
output
[]
=
'Request URI: '
.
$request
->
getUri
();
}
}
public
function
postExecuteRequest
()
public
function
postExecuteRequest
(
$request
,
$response
)
{
{
$this
->
timer
(
'postExecuteRequest'
);
$this
->
timer
(
'postExecuteRequest'
);
}
}
public
function
preCreateResult
()
public
function
preCreateResult
(
$query
,
$response
)
{
{
$this
->
timer
(
'preCreateResult'
);
$this
->
timer
(
'preCreateResult'
);
}
}
public
function
postCreateResult
()
public
function
postCreateResult
(
$query
,
$response
,
$result
)
{
{
$this
->
timer
(
'postCreateResult'
);
$this
->
timer
(
'postCreateResult'
);
}
}
public
function
preExecute
()
public
function
preExecute
(
$query
)
{
{
$this
->
timer
(
'preExecute'
);
$this
->
timer
(
'preExecute'
);
}
}
public
function
postExecute
()
public
function
postExecute
(
$query
,
$result
)
{
{
$this
->
timer
(
'postExecute'
);
$this
->
timer
(
'postExecute'
);
}
}
public
function
preCreateQuery
()
public
function
preCreateQuery
(
$type
,
$options
)
{
{
$this
->
timer
(
'preCreateResult'
);
$this
->
timer
(
'preCreateResult'
);
}
}
public
function
postCreateQuery
()
public
function
postCreateQuery
(
$type
,
$options
,
$query
)
{
{
$this
->
timer
(
'postCreateResult'
);
$this
->
timer
(
'postCreateResult'
);
}
}
...
...
examples/5.3.2-plugin-solarium-presets.php
View file @
4158c2e0
<?php
<?php
require
(
'init.php'
);
require
(
'init.php'
);
use
Solarium\Client
;
use
Solarium\Client
;
use
Solarium\
Plugin\Abstract
Plugin
;
use
Solarium\
Core\
Plugin
;
use
Solarium\Query\Select\Query\Query
as
Select
;
use
Solarium\Query\Select\Query\Query
as
Select
;
// This is a custom query class that could have some customized logic
// This is a custom query class that could have some customized logic
...
@@ -11,12 +11,12 @@ class MyQuery extends Select
...
@@ -11,12 +11,12 @@ class MyQuery extends Select
}
}
// this very simple plugin that modifies the default querytype mapping
// this very simple plugin that modifies the default querytype mapping
class
queryCustomizer
extends
Abstract
Plugin
class
queryCustomizer
extends
Plugin
{
{
p
rotected
function
_initPlugin
(
)
p
ublic
function
initPlugin
(
$client
,
$options
)
{
{
$
this
->
_
client
->
registerQueryType
(
$client
->
registerQueryType
(
Client
::
QUERY_SELECT
,
Client
::
QUERY_SELECT
,
'MyQuery'
,
'MyQuery'
,
'Solarium\Query\Select\RequestBuilder\RequestBuilder'
,
'Solarium\Query\Select\RequestBuilder\RequestBuilder'
,
...
...
examples/6.1.1-zend-http-adapter.php
View file @
4158c2e0
...
@@ -10,7 +10,7 @@ htmlHeader();
...
@@ -10,7 +10,7 @@ htmlHeader();
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
(
$config
);
// set the adapter to zendhttp and get a zendhttp client instance reference
// set the adapter to zendhttp and get a zendhttp client instance reference
$client
->
setAdapter
(
'Solarium\Client\Adapter\ZendHttp'
);
$client
->
setAdapter
(
'Solarium\C
ore\C
lient\Adapter\ZendHttp'
);
$zendHttp
=
$client
->
getAdapter
()
->
getZendHttp
();
$zendHttp
=
$client
->
getAdapter
()
->
getZendHttp
();
// you can use any of the zend_http features, like http-authentication
// you can use any of the zend_http features, like http-authentication
...
...
examples/6.1.2-pecl-http-adapter.php
View file @
4158c2e0
...
@@ -10,7 +10,7 @@ htmlHeader();
...
@@ -10,7 +10,7 @@ htmlHeader();
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
(
$config
);
// set the adapter to peclhttp
// set the adapter to peclhttp
$client
->
setAdapter
(
'Solarium\Client\Adapter\PeclHttp'
);
$client
->
setAdapter
(
'Solarium\C
ore\C
lient\Adapter\PeclHttp'
);
// get a select query instance
// get a select query instance
$query
=
$client
->
createSelect
();
$query
=
$client
->
createSelect
();
...
...
examples/6.1.3-curl-adapter.php
View file @
4158c2e0
...
@@ -10,7 +10,7 @@ htmlHeader();
...
@@ -10,7 +10,7 @@ htmlHeader();
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
(
$config
);
// set the adapter to curl
// set the adapter to curl
$client
->
setAdapter
(
'Solarium\Client\Adapter\Curl'
);
$client
->
setAdapter
(
'Solarium\C
ore\C
lient\Adapter\Curl'
);
// get a select query instance
// get a select query instance
$query
=
$client
->
createSelect
();
$query
=
$client
->
createSelect
();
...
...
examples/7.5-plugin-bufferedadd.php
View file @
4158c2e0
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
require
(
'init.php'
);
require
(
'init.php'
);
// this very simple plugin is used to show some events
// this very simple plugin is used to show some events
class
simpleDebug
extends
\Solarium\Plugin\Abstract
Plugin
class
simpleDebug
extends
Solarium\Core\
Plugin
{
{
protected
$_output
=
array
();
protected
$_output
=
array
();
public
function
display
()
public
function
display
()
...
...
library/Solarium/Plugin/ParallelExecution.php
View file @
4158c2e0
...
@@ -83,7 +83,7 @@ class ParallelExecution extends Plugin
...
@@ -83,7 +83,7 @@ class ParallelExecution extends Plugin
*/
*/
protected
function
initPluginType
()
protected
function
initPluginType
()
{
{
$this
->
client
->
setAdapter
(
'Solarium\Client\Adapter\Curl'
);
$this
->
client
->
setAdapter
(
'Solarium\C
ore\C
lient\Adapter\Curl'
);
}
}
/**
/**
...
...
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