File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -305,6 +305,49 @@ Elasticsearch [Matrix](https://www.elastic.co/guide/en/elasticsearch/reference/c
305305``` php
306306$stats = Product::whereNotIn('color', ['red','green'])->matrix('price');
307307$stats = Product::whereNotIn('color', ['red', 'green'])->matrix(['price', 'orders']);
308+ ```
309+ Matrix results return as (example):
310+ ``` json
311+ {
312+ "matrix" : {
313+ "doc_count" : 24 ,
314+ "fields" : [
315+ {
316+ "name" : " price" ,
317+ "count" : 24 ,
318+ "mean" : 944.1987476348877 ,
319+ "variance" : 392916.60523541126 ,
320+ "skewness" : 0.1301389603055256 ,
321+ "kurtosis" : 1.6419181162499876 ,
322+ "covariance" : {
323+ "price" : 392916.60523541126 ,
324+ "orders" : 5569.635773119718
325+ },
326+ "correlation" : {
327+ "price" : 1 ,
328+ "orders" : 0.03421141805225852
329+ }
330+ },
331+ {
332+ "name" : " orders" ,
333+ "count" : 24 ,
334+ "mean" : 501.79166666666663 ,
335+ "variance" : 67454.5199275362 ,
336+ "skewness" : 0.31085136523548346 ,
337+ "kurtosis" : 1.9897405370026835 ,
338+ "covariance" : {
339+ "price" : 5569.635773119718 ,
340+ "orders" : 67454.5199275362
341+ },
342+ "correlation" : {
343+ "price" : 0.03421141805225852 ,
344+ "orders" : 1
345+ }
346+ }
347+ ]
348+ }
349+ }
350+
308351```
309352
310353### Ordering
You can’t perform that action at this time.
0 commit comments