Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Marko Bekhta <[email protected]>
  • Loading branch information
fax4ever and marko-bekhta authored Sep 4, 2024
1 parent 220288d commit 81e751a
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ The fields that are targeted by the aggregation function must be declared <<mapp

The `sum` aggregation sums up the field values.

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

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

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

=== Count metric aggregation

The `count` aggregation counts the field values.
The `count` aggregation counts the number of documents in which the field is not empty.

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

=== Count distinct metric aggregation

The `count distinct` aggregation counts the different field values.
The `count distinct` aggregation counts the number of unique field values.

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

=== Avg metric aggregation

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

.Compute the average of the prices all of the science fiction books
.Compute the average price of all science fiction books
====
[source, JAVA, indent=0, subs="+callouts"]
----
Expand Down

0 comments on commit 81e751a

Please sign in to comment.