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
4e71fc88
Commit
4e71fc88
authored
Dec 19, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated examples for namespacing
parent
cd4dc257
Changes
48
Show whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
78 additions
and
78 deletions
+78
-78
examples/1.1-check-solarium-and-ping.php
examples/1.1-check-solarium-and-ping.php
+1
-1
examples/1.2-basic-select.php
examples/1.2-basic-select.php
+2
-2
examples/1.3-basic-update.php
examples/1.3-basic-update.php
+2
-2
examples/2.1.1-query-params.php
examples/2.1.1-query-params.php
+3
-3
examples/2.1.2-custom-result-document.php
examples/2.1.2-custom-result-document.php
+1
-1
examples/2.1.3-filterquery.php
examples/2.1.3-filterquery.php
+1
-1
examples/2.1.5.1.1-facet-field.php
examples/2.1.5.1.1-facet-field.php
+1
-1
examples/2.1.5.1.2-facet-query.php
examples/2.1.5.1.2-facet-query.php
+1
-1
examples/2.1.5.1.3-facet-multiquery.php
examples/2.1.5.1.3-facet-multiquery.php
+1
-1
examples/2.1.5.1.4-facet-range.php
examples/2.1.5.1.4-facet-range.php
+1
-1
examples/2.1.5.10-stats.php
examples/2.1.5.10-stats.php
+1
-1
examples/2.1.5.11-debug.php
examples/2.1.5.11-debug.php
+1
-1
examples/2.1.5.2-morelikethis.php
examples/2.1.5.2-morelikethis.php
+2
-2
examples/2.1.5.3-highlighting.php
examples/2.1.5.3-highlighting.php
+2
-2
examples/2.1.5.3.1-per-field-highlighting.php
examples/2.1.5.3.1-per-field-highlighting.php
+1
-1
examples/2.1.5.4-dismax.php
examples/2.1.5.4-dismax.php
+2
-2
examples/2.1.5.5-edismax.php
examples/2.1.5.5-edismax.php
+2
-2
examples/2.1.5.6-grouping-by-field.php
examples/2.1.5.6-grouping-by-field.php
+2
-2
examples/2.1.5.7-grouping-by-query.php
examples/2.1.5.7-grouping-by-query.php
+1
-1
examples/2.1.5.8-distributed-search.php
examples/2.1.5.8-distributed-search.php
+1
-1
examples/2.1.5.9-spellcheck.php
examples/2.1.5.9-spellcheck.php
+1
-1
examples/2.1.6-helper-functions.php
examples/2.1.6-helper-functions.php
+1
-1
examples/2.1.7-query-reuse.php
examples/2.1.7-query-reuse.php
+2
-2
examples/2.2.1-add-docs.php
examples/2.2.1-add-docs.php
+1
-1
examples/2.2.2-delete-by-query.php
examples/2.2.2-delete-by-query.php
+1
-1
examples/2.2.3-delete-by-id.php
examples/2.2.3-delete-by-id.php
+1
-1
examples/2.2.4-optimize.php
examples/2.2.4-optimize.php
+1
-1
examples/2.2.5-rollback.php
examples/2.2.5-rollback.php
+1
-1
examples/2.3.1-mlt-query.php
examples/2.3.1-mlt-query.php
+2
-2
examples/2.3.2-mlt-stream.php
examples/2.3.2-mlt-stream.php
+2
-2
examples/2.4.1-analysis-document.php
examples/2.4.1-analysis-document.php
+1
-1
examples/2.4.2-analysis-field.php
examples/2.4.2-analysis-field.php
+1
-1
examples/2.5-terms-query.php
examples/2.5-terms-query.php
+1
-1
examples/4.1-api-usage.php
examples/4.1-api-usage.php
+2
-2
examples/4.2-configuration-usage.php
examples/4.2-configuration-usage.php
+1
-1
examples/4.3-extending-usage.php
examples/4.3-extending-usage.php
+1
-1
examples/5.1-partial-usage.php
examples/5.1-partial-usage.php
+2
-2
examples/5.2-extending.php
examples/5.2-extending.php
+5
-5
examples/5.3.1-plugin-event-hooks.php
examples/5.3.1-plugin-event-hooks.php
+2
-2
examples/5.3.2-plugin-solarium-presets.php
examples/5.3.2-plugin-solarium-presets.php
+7
-7
examples/6.1.1-zend-http-adapter.php
examples/6.1.1-zend-http-adapter.php
+2
-2
examples/6.1.2-pecl-http-adapter.php
examples/6.1.2-pecl-http-adapter.php
+2
-2
examples/6.1.3-curl-adapter.php
examples/6.1.3-curl-adapter.php
+1
-1
examples/6.2-escaping.php
examples/6.2-escaping.php
+2
-2
examples/6.3-placeholder-syntax.php
examples/6.3-placeholder-syntax.php
+2
-2
examples/7.1-plugin-loadbalancer.php
examples/7.1-plugin-loadbalancer.php
+2
-2
examples/7.2-plugin-postbigrequest.php
examples/7.2-plugin-postbigrequest.php
+1
-1
examples/7.3-plugin-customizerequest.php
examples/7.3-plugin-customizerequest.php
+1
-1
No files found.
examples/1.1-check-solarium-and-ping.php
View file @
4e71fc88
...
...
@@ -7,7 +7,7 @@ htmlHeader();
echo
'Solarium library version: '
.
Solarium\Version
::
VERSION
.
' - '
;
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// create a ping query
$ping
=
$client
->
createPing
();
...
...
examples/1.2-basic-select.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/1.3-basic-update.php
View file @
4e71fc88
...
...
@@ -7,7 +7,7 @@ if ($_POST) {
// if data is posted add it to solr
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an update query instance
$update
=
$client
->
createUpdate
();
...
...
examples/2.1.1-query-params.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
@@ -19,7 +19,7 @@ $query->setStart(2)->setRows(20);
$query
->
setFields
(
array
(
'id'
,
'name'
,
'price'
));
// sort the results by price ascending
$query
->
addSort
(
'price'
,
Solarium\Query\Select
::
SORT_ASC
);
$query
->
addSort
(
'price'
,
Solarium\Query\Select
\Select
::
SORT_ASC
);
// this executes the query and returns the result
$resultset
=
$client
->
select
(
$query
);
...
...
examples/2.1.2-custom-result-document.php
View file @
4e71fc88
...
...
@@ -16,7 +16,7 @@ class myDoc extends Solarium\Document\ReadOnly{
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.3-filterquery.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.1.1-facet-field.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.1.2-facet-query.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.1.3-facet-multiquery.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.1.4-facet-range.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.10-stats.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.11-debug.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.2-morelikethis.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.3-highlighting.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.3.1-per-field-highlighting.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.4-dismax.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.5-edismax.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.6-grouping-by-field.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.7-grouping-by-query.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.8-distributed-search.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.5.9-spellcheck.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.6-helper-functions.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance and a query helper instance
$query
=
$client
->
createSelect
();
...
...
examples/2.1.7-query-reuse.php
View file @
4e71fc88
...
...
@@ -4,11 +4,11 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// first create a base query as a query class
class
PriceQuery
extends
Solarium\Query\Select
class
PriceQuery
extends
Solarium\Query\Select
\Select
{
protected
function
_init
()
{
...
...
examples/2.2.1-add-docs.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an update query instance
$update
=
$client
->
createUpdate
();
...
...
examples/2.2.2-delete-by-query.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an update query instance
$update
=
$client
->
createUpdate
();
...
...
examples/2.2.3-delete-by-id.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an update query instance
$update
=
$client
->
createUpdate
();
...
...
examples/2.2.4-optimize.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an update query instance
$update
=
$client
->
createUpdate
();
...
...
examples/2.2.5-rollback.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an update query instance
$update
=
$client
->
createUpdate
();
...
...
examples/2.3.1-mlt-query.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a morelikethis query instance
$query
=
$client
->
createMoreLikeThis
();
...
...
examples/2.3.2-mlt-stream.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a morelikethis query instance
$query
=
$client
->
createMoreLikeThis
();
...
...
examples/2.4.1-analysis-document.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an analysis document query
$query
=
$client
->
createAnalysisDocument
();
...
...
examples/2.4.2-analysis-field.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get an analysis document query
$query
=
$client
->
createAnalysisField
();
...
...
examples/2.5-terms-query.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a terms query instance
$query
=
$client
->
createTerms
();
...
...
examples/4.1-api-usage.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
@@ -13,7 +13,7 @@ $query = $client->createSelect();
$query
->
setQuery
(
'*:*'
);
$query
->
setStart
(
2
)
->
setRows
(
20
);
$query
->
setFields
(
array
(
'id'
,
'name'
,
'price'
));
$query
->
addSort
(
'price'
,
Solarium\Query\Select
::
SORT_ASC
);
$query
->
addSort
(
'price'
,
Solarium\Query\Select
\Select
::
SORT_ASC
);
// create a filterquery using the API
$fq
=
$query
->
createFilterQuery
(
'maxprice'
)
->
setQuery
(
'price:[1 TO 300]'
);
...
...
examples/4.2-configuration-usage.php
View file @
4e71fc88
...
...
@@ -29,7 +29,7 @@ $select = array(
);
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance based on the config
$query
=
$client
->
createSelect
(
$select
);
...
...
examples/4.3-extending-usage.php
View file @
4e71fc88
...
...
@@ -39,7 +39,7 @@ class ProductPriceLimitedQuery extends ProductQuery{
}
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// create a query instance
$query
=
new
ProductPriceLimitedQuery
;
...
...
examples/5.1-partial-usage.php
View file @
4e71fc88
...
...
@@ -10,7 +10,7 @@ htmlHeader();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// create a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/5.2-extending.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// This is a custom query class that could have some customized logic
class
MyQuery
extends
Solarium\Query\Select
class
MyQuery
extends
Solarium\Query\Select
\Select
{
// ...customization here...
}
...
...
@@ -12,7 +12,7 @@ class MyQuery extends Solarium\Query\Select
// And this is the extended client, that modifies the default query mapping
// for select queries to our custom query class.
// BTW, the same could also be done using a plugin, see example 5.3.2
class
MyClient
extends
Solarium\Client
class
MyClient
extends
Solarium\Client
\Client
{
/**
* Querytype mappings
...
...
@@ -20,8 +20,8 @@ class MyClient extends Solarium\Client
protected
$_queryTypes
=
array
(
self
::
QUERYTYPE_SELECT
=>
array
(
'query'
=>
'MyQuery'
,
'requestbuilder'
=>
'Solarium\Client\RequestBuilder\Select'
,
'responseparser'
=>
'Solarium\Client\ResponseParser\Select'
'requestbuilder'
=>
'Solarium\Client\RequestBuilder\Select
\Select
'
,
'responseparser'
=>
'Solarium\Client\ResponseParser\Select
\Select
'
),
self
::
QUERYTYPE_UPDATE
=>
array
(
'query'
=>
'Solarium\Query\Update'
,
...
...
examples/5.3.1-plugin-event-hooks.php
View file @
4e71fc88
...
...
@@ -3,7 +3,7 @@ require('init.php');
// this very simple plugin shows a timing for each event and display some request debug info
class
basicDebug
extends
Solarium\PluginAbstractPlugin
class
basicDebug
extends
Solarium\Plugin
\
AbstractPlugin
{
protected
$_start
;
...
...
@@ -90,7 +90,7 @@ htmlHeader();
// create a client instance and register the plugin
$plugin
=
new
basicDebug
();
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
$client
->
registerPlugin
(
'debugger'
,
$plugin
);
// execute a select query and display the results
...
...
examples/5.3.2-plugin-solarium-presets.php
View file @
4e71fc88
...
...
@@ -2,22 +2,22 @@
require
(
'init.php'
);
// This is a custom query class that could have some customized logic
class
MyQuery
extends
Solarium\Query\Select
class
MyQuery
extends
Solarium\Query\Select
\Select
{
// ...customization here...
}
// this very simple plugin that modifies the default querytype mapping
class
queryCustomizer
extends
Solarium\PluginAbstractPlugin
class
queryCustomizer
extends
Solarium\Plugin
\
AbstractPlugin
{
protected
function
_initPlugin
()
{
$this
->
_client
->
registerQueryType
(
Solarium\Client
::
QUERYTYPE_SELECT
,
Solarium\Client
\Client
::
QUERYTYPE_SELECT
,
'MyQuery'
,
'Solarium\Client\RequestBuilder\Select'
,
'Solarium\Client\ResponseParser\Select'
'Solarium\Client\RequestBuilder\Select
\Select
'
,
'Solarium\Client\ResponseParser\Select
\Select
'
);
}
...
...
@@ -27,7 +27,7 @@ class queryCustomizer extends Solarium\PluginAbstractPlugin
htmlHeader
();
// create a client instance and register the plugin
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
$client
->
registerPlugin
(
'querycustomizer'
,
'queryCustomizer'
);
// create a select query instance
...
...
examples/6.1.1-zend-http-adapter.php
View file @
4e71fc88
...
...
@@ -7,7 +7,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// set the adapter to zendhttp and get a zendhttp client instance reference
$client
->
setAdapter
(
'Solarium\Client\Adapter\ZendHttp'
);
...
...
examples/6.1.2-pecl-http-adapter.php
View file @
4e71fc88
...
...
@@ -7,7 +7,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// set the adapter to peclhttp
$client
->
setAdapter
(
'Solarium\Client\Adapter\PeclHttp'
);
...
...
examples/6.1.3-curl-adapter.php
View file @
4e71fc88
...
...
@@ -7,7 +7,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// set the adapter to curl
$client
->
setAdapter
(
'Solarium\Client\Adapter\Curl'
);
...
...
examples/6.2-escaping.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/6.3-placeholder-syntax.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
...
...
examples/7.1-plugin-loadbalancer.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance and get loadbalancer plugin instance
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
$loadbalancer
=
$client
->
getPlugin
(
'loadbalancer'
);
// apply loadbalancer settings
...
...
@@ -39,7 +39,7 @@ echo 'Loadbalanced ping query, should display a loadbalancing server:<br/>';
echo
'Ping server: '
.
$loadbalancer
->
getLastServerKey
()
.
'<hr/>'
;
// exclude ping query from loadbalancing
$loadbalancer
->
addBlockedQueryType
(
Solarium\Client
::
QUERYTYPE_PING
);
$loadbalancer
->
addBlockedQueryType
(
Solarium\Client
\Client
::
QUERYTYPE_PING
);
$client
->
ping
(
$query
);
echo
'Non-loadbalanced ping query, should not display a loadbalancing server:<br/>'
;
echo
'Ping server: '
.
$loadbalancer
->
getLastServerKey
()
.
'<hr/>'
;
...
...
examples/7.2-plugin-postbigrequest.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance and autoload the postbigrequest plugin
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
$client
->
getPlugin
(
'postbigrequest'
);
// create a basic query to execute
...
...
examples/7.3-plugin-customizerequest.php
View file @
4e71fc88
...
...
@@ -4,7 +4,7 @@ require('init.php');
htmlHeader
();
// create a client instance and autoload the customize request plugin
$client
=
new
Solarium\Client
(
$config
);
$client
=
new
Solarium\Client
\Client
(
$config
);
$customizer
=
$client
->
getPlugin
(
'customizerequest'
);
// add a persistent HTTP header (using array input values)
...
...
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