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
dc1cbe8a
Commit
dc1cbe8a
authored
Feb 16, 2016
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #398 from eborned/stats-percentiles
Stats percentiles
parents
db31da77
29ce9726
Changes
1
Hide 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 @
dc1cbe8a
...
...
@@ -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
[
$name
])
?
$this
->
stats
[
$name
]
:
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