Skip to content

Commit 81e751a

Browse files
Apply suggestions from code review
Co-authored-by: Marko Bekhta <[email protected]>
1 parent 220288d commit 81e751a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

documentation/src/main/asciidoc/public/reference/_search-dsl-aggregation.adoc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ The fields that are targeted by the aggregation function must be declared <<mapp
347347

348348
The `sum` aggregation sums up the field values.
349349

350-
.Sum the prices all of the science fiction books
350+
.Sum the prices of all science fiction books
351351
====
352352
[source, JAVA, indent=0, subs="+callouts"]
353353
----
@@ -358,9 +358,10 @@ include::{sourcedir}/org/hibernate/search/documentation/search/aggregation/Aggre
358358

359359
[NOTE]
360360
====
361-
You can always use the field type for the expected returned type.
362-
Another option is to set `Double.class` for the expected returned type and you can always do it
363-
even if the field is not double typed.
361+
You can always use the field type for the expected returned value.
362+
Alternatively, as aggregations usually involve some mathematical computations,
363+
it is possible to request a `Double.class` result, which will return the aggregated value
364+
as the corresponding search backend computed it.
364365
====
365366

366367
=== Min metric aggregation
@@ -391,9 +392,9 @@ include::{sourcedir}/org/hibernate/search/documentation/search/aggregation/Aggre
391392

392393
=== Count metric aggregation
393394

394-
The `count` aggregation counts the field values.
395+
The `count` aggregation counts the number of documents in which the field is not empty.
395396

396-
.Count anytime the price field has a value among all the science fiction books
397+
.Count the number of the science fiction books with prices
397398
====
398399
[source, JAVA, indent=0, subs="+callouts"]
399400
----
@@ -404,7 +405,7 @@ include::{sourcedir}/org/hibernate/search/documentation/search/aggregation/Aggre
404405

405406
=== Count distinct metric aggregation
406407

407-
The `count distinct` aggregation counts the different field values.
408+
The `count distinct` aggregation counts the number of unique field values.
408409

409410
.Count anytime the price field has a different value among all the science fiction books
410411
====
@@ -417,9 +418,9 @@ include::{sourcedir}/org/hibernate/search/documentation/search/aggregation/Aggre
417418

418419
=== Avg metric aggregation
419420

420-
Applies the SQL `avg` aggregation function on a given numeric or temporal field.
421+
The `avg` aggregation calculates the average value of a given numeric or temporal field among the selected documents.
421422

422-
.Compute the average of the prices all of the science fiction books
423+
.Compute the average price of all science fiction books
423424
====
424425
[source, JAVA, indent=0, subs="+callouts"]
425426
----

0 commit comments

Comments
 (0)