Merge branch 'master' into mas-i178-bookhead

This commit is contained in:
Martin Sumner 2018-09-20 12:08:46 +01:00
commit d999bc1e4a

View file

@ -565,29 +565,31 @@ book_returnfolder(Pid, RunnerType) ->
%% with the index `?IDX_TAG' and Constrain the fold to a specific %% with the index `?IDX_TAG' and Constrain the fold to a specific
%% `Bucket''s index fields, as specified by the `Constraint' %% `Bucket''s index fields, as specified by the `Constraint'
%% argument. If `Constraint' is a tuple of `{Bucket, Key}' the fold %% argument. If `Constraint' is a tuple of `{Bucket, Key}' the fold
%% starts at `Key' (this is useful for implementing pagination, for %% starts at `Key', meaning any keys lower than `Key' and which match
%% example.) Provide a `FoldAccT' tuple of fold fun ( which is 3 %% the start of the range query, will not be folded over (this is
%% arity fun that will be called once per-matching index entry, with %% useful for implementing pagination, for example.)
%% the Bucket, Primary Key (or {IndexVal and Primary key} if %%
%% `ReturnTerms' is true)) and an initial Accumulator, which will be %% Provide a `FoldAccT' tuple of fold fun ( which is 3 arity fun that
%% passed as the 3rd argument in the initial call to %% will be called once per-matching index entry, with the Bucket,
%% FoldFun. Subsequent calls to FoldFun will use the previous return %% Primary Key (or {IndexVal and Primary key} if `ReturnTerms' is
%% of FoldFun as the 3rd argument, and the final return of `Runner' is %% true)) and an initial Accumulator, which will be passed as the 3rd
%% the final return of `FoldFun', the final Accumulator value. The %% argument in the initial call to FoldFun. Subsequent calls to
%% query can filter inputs based on `Range' and `TermHandling'. %% FoldFun will use the previous return of FoldFun as the 3rd
%% `Range' specifies the name of `IndexField' to query, and `Start' %% argument, and the final return of `Runner' is the final return of
%% and `End' optionally provide the range to query over. %% `FoldFun', the final Accumulator value. The query can filter inputs
%% `TermHandling' is a 2-tuple, the first element is a `boolean()', %% based on `Range' and `TermHandling'. `Range' specifies the name of
%% `true' meaning return terms, (see fold fun above), `false' meaning %% `IndexField' to query, and `Start' and `End' optionally provide the
%% just return primary keys. `TermRegex' is either a regular %% range to query over. `TermHandling' is a 2-tuple, the first
%% expression of type `re:mp()' (that will be run against each index %% element is a `boolean()', `true' meaning return terms, (see fold
%% term value, and only those that match will be accumulated) or %% fun above), `false' meaning just return primary keys. `TermRegex'
%% `undefined', which means no regular expression filtering of index %% is either a regular expression of type `re:mp()' (that will be run
%% values. NOTE: Regular Expressions can ONLY be run on indexes that %% against each index term value, and only those that match will be
%% have binary or string values, NOT integer values. In the Riak sense %% accumulated) or `undefined', which means no regular expression
%% of secondary indexes, there are two types of indexes `_bin' indexes %% filtering of index values. NOTE: Regular Expressions can ONLY be
%% and `_int' indexes. Term regex may only be run against the `_bin' %% run on indexes that have binary or string values, NOT integer
%% type. %% values. In the Riak sense of secondary indexes, there are two types
%% of indexes `_bin' indexes and `_int' indexes. Term regex may only
%% be run against the `_bin' type.
-spec book_indexfold(pid(), -spec book_indexfold(pid(),
Constraint:: {Bucket, Key} | Bucket, Constraint:: {Bucket, Key} | Bucket,
FoldAccT :: {FoldFun, Acc}, FoldAccT :: {FoldFun, Acc},