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
47b42f7b
Commit
47b42f7b
authored
Nov 14, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added debug component example
parent
fcb9bf90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
examples/2.1.5.11-debug.php
examples/2.1.5.11-debug.php
+69
-0
examples/index.html
examples/index.html
+1
-0
No files found.
examples/2.1.5.11-debug.php
0 → 100644
View file @
47b42f7b
<?php
require
(
'init.php'
);
htmlHeader
();
// create a client instance
$client
=
new
Solarium_Client
(
$config
);
// get a select query instance
$query
=
$client
->
createSelect
();
$query
->
setQuery
(
'ipod'
);
// add debug settings
$debug
=
$query
->
getDebug
();
$debug
->
setExplainOther
(
'id:MA*'
);
// this executes the query and returns the result
$resultset
=
$client
->
select
(
$query
);
$debugResult
=
$resultset
->
getDebug
();
// display the debug results
echo
'<h1>Debug data</h1>'
;
echo
'Querystring: '
.
$debugResult
->
getQueryString
()
.
'<br/>'
;
echo
'Parsed query: '
.
$debugResult
->
getParsedQuery
()
.
'<br/>'
;
echo
'Query parser: '
.
$debugResult
->
getQueryParser
()
.
'<br/>'
;
echo
'Other query: '
.
$debugResult
->
getOtherQuery
()
.
'<br/>'
;
echo
'<h2>Explain data</h2>'
;
foreach
(
$debugResult
->
getExplain
()
as
$key
=>
$explanation
)
{
echo
'<h3>Document key: '
.
$key
.
'</h3>'
;
echo
'Value: '
.
$explanation
->
getValue
()
.
'<br/>'
;
echo
'Match: '
.
((
$explanation
->
getMatch
()
==
true
)
?
'true'
:
'false'
)
.
'<br/>'
;
echo
'Description: '
.
$explanation
->
getDescription
()
.
'<br/>'
;
echo
'<h4>Details</h4>'
;
foreach
(
$explanation
AS
$detail
)
{
echo
'Value: '
.
$detail
->
getValue
()
.
'<br/>'
;
echo
'Match: '
.
((
$detail
->
getMatch
()
==
true
)
?
'true'
:
'false'
)
.
'<br/>'
;
echo
'Description: '
.
$detail
->
getDescription
()
.
'<br/>'
;
echo
'<hr/>'
;
}
}
echo
'<h2>ExplainOther data</h2>'
;
foreach
(
$debugResult
->
getExplainOther
()
as
$key
=>
$explanation
)
{
echo
'<h3>Document key: '
.
$key
.
'</h3>'
;
echo
'Value: '
.
$explanation
->
getValue
()
.
'<br/>'
;
echo
'Match: '
.
((
$explanation
->
getMatch
()
==
true
)
?
'true'
:
'false'
)
.
'<br/>'
;
echo
'Description: '
.
$explanation
->
getDescription
()
.
'<br/>'
;
echo
'<h4>Details</h4>'
;
foreach
(
$explanation
AS
$detail
)
{
echo
'Value: '
.
$detail
->
getValue
()
.
'<br/>'
;
echo
'Match: '
.
((
$detail
->
getMatch
()
==
true
)
?
'true'
:
'false'
)
.
'<br/>'
;
echo
'Description: '
.
$detail
->
getDescription
()
.
'<br/>'
;
echo
'<hr/>'
;
}
}
echo
'<h2>Timings (in ms)</h2>'
;
echo
'Total time: '
.
$debugResult
->
getTiming
()
->
getTime
()
.
'<br/>'
;
echo
'<h3>Phases</h3>'
;
foreach
(
$debugResult
->
getTiming
()
->
getPhases
()
as
$phaseName
=>
$phaseData
)
{
echo
'<h4>'
.
$phaseName
.
'</h4>'
;
foreach
(
$phaseData
as
$class
=>
$time
)
{
echo
$class
.
': '
.
$time
.
'<br/>'
;
}
echo
'<hr/>'
;
}
htmlFooter
();
\ No newline at end of file
examples/index.html
View file @
47b42f7b
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
<li><a
href=
"2.1.5.8-distributed-search.php"
>
2.1.5.8 Distributed search (sharding)
</a></li>
<li><a
href=
"2.1.5.8-distributed-search.php"
>
2.1.5.8 Distributed search (sharding)
</a></li>
<li><a
href=
"2.1.5.9-spellcheck.php"
>
2.1.5.9 Spellcheck
</a></li>
<li><a
href=
"2.1.5.9-spellcheck.php"
>
2.1.5.9 Spellcheck
</a></li>
<li><a
href=
"2.1.5.10-stats.php"
>
2.1.5.10 Stats
</a></li>
<li><a
href=
"2.1.5.10-stats.php"
>
2.1.5.10 Stats
</a></li>
<li><a
href=
"2.1.5.11-debug.php"
>
2.1.5.11 Debug (DebugQuery)
</a></li>
</ul>
</ul>
<li><a
href=
"2.1.6-helper-functions.php"
>
2.1.6 Helper functions
</a></li>
<li><a
href=
"2.1.6-helper-functions.php"
>
2.1.6 Helper functions
</a></li>
<li><a
href=
"2.1.7-query-reuse.php"
>
2.1.7 Query re-use
</a></li>
<li><a
href=
"2.1.7-query-reuse.php"
>
2.1.7 Query re-use
</a></li>
...
...
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