git.iko.soy/typeable/bloodhound
on master help sign in
Fix mangled by converting tildes in org mode
commit3e4bea42698f63f17e91d31f54a5bbd727f3e281 authorMichael Xavier <michael@michaelxavier.net> dateSun 24 Jan 2016, 12:37 (11 years ago) parentccb3201
1 file changed+15−9
README.md+15−9
README.md+15−9
@@ -758,7 +758,8 @@ Since the \`\`\`Aggregations\`\`\` structure is just a Map Text Aggregation, M.i
758758
759759#### Extracting aggregations from results
760760
761−Aggregations are part of the reply structure of every search, in the form of
761+Aggregations are part of the reply structure of every search, in the
762+form of `Maybe AggregationResults`
762763
763764``` {.haskell}
764765-- Lift decode and response body to be in the IO monad.
@@ -774,7 +775,7 @@ terms
774775Just (Bucket {buckets = [TermsResult {termKey = "bitemyapp", termsDocCount = 1, termsAggs = Nothing}]})
775776```
776777
777−Note that bucket aggregation results, such as the TermsResult is a member of the type class :
778+Note that bucket aggregation results, such as the TermsResult is a member of the type class `BucketAggregation`:
778779
779780``` {.haskell}
780781class BucketAggregation a where
@@ -783,7 +784,10 @@ class BucketAggregation a where
783784 aggs :: a -> Maybe AggregationResults
784785```
785786
786−You can use the function to get any nested results, if there were any. For example, if there were a nested terms aggregation keyed to "age" in a TermsResult named , you would call
787+You can use the `aggs` function to get any nested results, if there
788+were any. For example, if there were a nested terms aggregation keyed
789+to "age" in a TermsResult named `termresult` , you would call `aggs
790+termresult >>= toTerms "age"`
787791
788792#### Terms Aggregation
789793
@@ -801,7 +805,8 @@ data TermsAggregation
801805 termAggs :: Maybe Aggregations}
802806```
803807
804−Term Aggregations have two factory functions, , and , and can be used as follows:
808+Term Aggregations have two factory functions, `mkTermsAggregation`, and
809+`mkTermsScriptAggregation`, and can be used as follows:
805810
806811``` {.haskell}
807812let ta = TermsAgg $ mkTermsAggregation "user"
@@ -833,13 +838,13 @@ data DateHistogramAggregation
833838
834839The Date Histogram Aggregation works much the same as the Terms Aggregation.
835840
836−Relevant functions include , and
841+Relevant functions include `mkDateHistogram`, and `toDateHistogram`
837842
838843``` {.haskell}
839844let dh = DateHistogramAgg (mkDateHistogram (FieldName "postDate") Minute)
840845```
841846
842−Date histograms also accept a :
847+Date histograms also accept a `FractionalInterval`:
843848
844849``` {.haskell}
845850FractionalInterval :: Float -> TimeInterval -> Interval
@@ -853,7 +858,7 @@ It can be used as follows:
853858let dh = DateHistogramAgg (mkDateHistogram (FieldName "postDate") (FractionalInterval 1.5 Minutes))
854859```
855860
856−The is defined as:
861+The `DateHistogramResult` is defined as:
857862
858863``` {.haskell}
859864data DateHistogramResult
@@ -863,9 +868,10 @@ data DateHistogramResult
863868 dateHistogramAggs :: Maybe AggregationResults}
864869```
865870
866−It is an instance of , and can have nested aggregations in each bucket.
871+It is an instance of `BucketAggregation`, and can have nested aggregations in each bucket.
867872
868−Buckets can be extracted from a using
873+Buckets can be extracted from an `AggregationResult` using
874+`toDateHistogram name`
869875
870876For more information on the Date Histogram Aggregation, see: <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html>
871877