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
4f5cbd05
Commit
4f5cbd05
authored
Feb 04, 2016
by
Eric Bus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for percentiles value.
Chcek existance of stats value before returning.
parent
96f441f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
library/Solarium/QueryType/Select/Result/Stats/Result.php
library/Solarium/QueryType/Select/Result/Stats/Result.php
+29
-9
No files found.
library/Solarium/QueryType/Select/Result/Stats/Result.php
View file @
4f5cbd05
...
...
@@ -88,7 +88,7 @@ class Result
*/
public
function
getMin
()
{
return
$this
->
stats
[
'min'
]
;
return
$this
->
getValue
(
'min'
)
;
}
/**
...
...
@@ -98,7 +98,7 @@ class Result
*/
public
function
getMax
()
{
return
$this
->
stats
[
'max'
]
;
return
$this
->
getValue
(
'max'
)
;
}
/**
...
...
@@ -108,7 +108,7 @@ class Result
*/
public
function
getSum
()
{
return
$this
->
stats
[
'sum'
]
;
return
$this
->
getValue
(
'sum'
)
;
}
/**
...
...
@@ -118,7 +118,7 @@ class Result
*/
public
function
getCount
()
{
return
$this
->
stats
[
'count'
]
;
return
$this
->
getValue
(
'count'
)
;
}
/**
...
...
@@ -128,7 +128,7 @@ class Result
*/
public
function
getMissing
()
{
return
$this
->
stats
[
'missing'
]
;
return
$this
->
getValue
(
'missing'
)
;
}
/**
...
...
@@ -138,7 +138,7 @@ class Result
*/
public
function
getSumOfSquares
()
{
return
$this
->
stats
[
'sumOfSquares'
]
;
return
$this
->
getValue
(
'sumOfSquares'
)
;
}
/**
...
...
@@ -148,7 +148,7 @@ class Result
*/
public
function
getMean
()
{
return
$this
->
stats
[
'mean'
]
;
return
$this
->
getValue
(
'mean'
)
;
}
/**
...
...
@@ -158,7 +158,7 @@ class Result
*/
public
function
getStddev
()
{
return
$this
->
stats
[
'stddev'
]
;
return
$this
->
getValue
(
'stddev'
)
;
}
/**
...
...
@@ -168,6 +168,26 @@ class Result
*/
public
function
getFacets
()
{
return
$this
->
stats
[
'facets'
];
return
$this
->
getValue
(
'facets'
);
}
/**
* Get percentile stats.
*
* @return array
*/
public
function
getPercentiles
()
{
return
$this
->
getValue
(
'percentiles'
);
}
/**
* Get value by name.
*
* @return string
*/
protected
function
getValue
(
$name
)
{
return
isset
(
$this
->
stats
[
'min'
])
?
$this
->
stats
[
'min'
]
:
null
;
}
}
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