anchor.diff:    #state{conn = Conn, bucket = Bucket, index = Index, get_opts = Opts} = State,
     TranslatedConditions = transform_conditions(DocName, Conditions),
     SortOpts = build_sort(Sort),
  -  Query = <<(build_query(TranslatedConditions))/binary>>,
  +  Query = <<(build_query(TranslatedConditions, Bucket))/binary>>,
     case search_keys_by(Conn, Index, Query, SortOpts, Limit, Offset) of
       {ok, {_Total, Keys}} ->
         Results = fetch_docs(DocName, Conn, Bucket, Keys, Opts),
  
positive.code:   %% keys.
    #state{conn = Conn, bucket = Bucket, index = Index, get_opts = Opts} = State,
    TranslatedConditions = transform_conditions(DocName, Conditions),
    Query = build_query(TranslatedConditions),
    case find_by_query_get_keys(Conn, Index, Query) of
      {ok, Keys} ->
        Results = fetch_docs(DocName, Conn, Bucket, Keys, Opts),
  
negative.code:   delete_map/4,
    update_map/5,
    search/6,
    build_query/2
  ]).
  
  %%%=============================================================================
  