summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2017-11-16 09:49:16 +0100
committerJan Lehnardt <jan@apache.org>2019-01-19 14:15:50 +0100
commit7dadd2b675ba450f7d4928e800c988fbb9f51672 (patch)
tree40c8f632c0c3181d450c347b9dbee4856d279f62
parent8d0bd01662ede65f26c79e93de4e7046438b318c (diff)
downloadcouchdb-7dadd2b675ba450f7d4928e800c988fbb9f51672.tar.gz
by-access-id: remove leftover code
-rw-r--r--src/couch/src/couch_access_native_proc.erl237
1 files changed, 0 insertions, 237 deletions
diff --git a/src/couch/src/couch_access_native_proc.erl b/src/couch/src/couch_access_native_proc.erl
index b4af7d129..a57d40943 100644
--- a/src/couch/src/couch_access_native_proc.erl
+++ b/src/couch/src/couch_access_native_proc.erl
@@ -132,240 +132,3 @@ map_doc(_St, {Doc}) ->
_Else ->
[[]] % no comprende
end.
-
-
-% index_doc(#st{indexes=Indexes}, Doc) ->
-% lists:map(fun(Idx) -> get_text_entries(Idx, Doc) end, Indexes).
-%
-%
-% get_index_entries({IdxProps}, Doc) ->
-% {Fields} = couch_util:get_value(<<"fields">>, IdxProps),
-% Selector = get_index_partial_filter_selector(IdxProps),
-% case should_index(Selector, Doc) of
-% false ->
-% [];
-% true ->
-% Values = get_index_values(Fields, Doc),
-% case lists:member(not_found, Values) of
-% true -> [];
-% false -> [[Values, null]]
-% end
-% end.
-%
-%
-% get_index_values(Fields, Doc) ->
-% lists:map(fun({Field, _Dir}) ->
-% case mango_doc:get_field(Doc, Field) of
-% not_found -> not_found;
-% bad_path -> not_found;
-% Value -> Value
-% end
-% end, Fields).
-%
-%
-% get_text_entries({IdxProps}, Doc) ->
-% Selector = get_index_partial_filter_selector(IdxProps),
-% case should_index(Selector, Doc) of
-% true ->
-% get_text_entries0(IdxProps, Doc);
-% false ->
-% []
-% end.
-%
-%
-% get_index_partial_filter_selector(IdxProps) ->
-% case couch_util:get_value(<<"partial_filter_selector">>, IdxProps) of
-% undefined ->
-% % this is to support legacy text indexes that had the partial_filter_selector
-% % set as selector
-% case couch_util:get_value(<<"selector">>, IdxProps, []) of
-% [] ->
-% {[]};
-% Else ->
-% Else
-% end;
-% [] ->
-% {[]};
-% Else ->
-% Else
-% end.
-%
-%
-% get_text_entries0(IdxProps, Doc) ->
-% DefaultEnabled = get_default_enabled(IdxProps),
-% IndexArrayLengths = get_index_array_lengths(IdxProps),
-% FieldsList = get_text_field_list(IdxProps),
-% TAcc = #tacc{
-% index_array_lengths = IndexArrayLengths,
-% fields = FieldsList
-% },
-% Fields0 = get_text_field_values(Doc, TAcc),
-% Fields = if not DefaultEnabled -> Fields0; true ->
-% add_default_text_field(Fields0)
-% end,
-% FieldNames = get_field_names(Fields),
-% Converted = convert_text_fields(Fields),
-% FieldNames ++ Converted.
-%
-%
-% get_text_field_values({Props}, TAcc) when is_list(Props) ->
-% get_text_field_values_obj(Props, TAcc, []);
-%
-% get_text_field_values(Values, TAcc) when is_list(Values) ->
-% IndexArrayLengths = TAcc#tacc.index_array_lengths,
-% NewPath = ["[]" | TAcc#tacc.path],
-% NewTAcc = TAcc#tacc{path = NewPath},
-% case IndexArrayLengths of
-% true ->
-% % We bypass make_text_field and directly call make_text_field_name
-% % because the length field name is not part of the path.
-% LengthFieldName = make_text_field_name(NewTAcc#tacc.path, <<"length">>),
-% LengthField = [{LengthFieldName, <<"length">>, length(Values)}],
-% get_text_field_values_arr(Values, NewTAcc, LengthField);
-% _ ->
-% get_text_field_values_arr(Values, NewTAcc, [])
-% end;
-%
-% get_text_field_values(Bin, TAcc) when is_binary(Bin) ->
-% make_text_field(TAcc, <<"string">>, Bin);
-%
-% get_text_field_values(Num, TAcc) when is_number(Num) ->
-% make_text_field(TAcc, <<"number">>, Num);
-%
-% get_text_field_values(Bool, TAcc) when is_boolean(Bool) ->
-% make_text_field(TAcc, <<"boolean">>, Bool);
-%
-% get_text_field_values(null, TAcc) ->
-% make_text_field(TAcc, <<"null">>, true).
-%
-%
-% get_text_field_values_obj([], _, FAcc) ->
-% FAcc;
-% get_text_field_values_obj([{Key, Val} | Rest], TAcc, FAcc) ->
-% NewPath = [Key | TAcc#tacc.path],
-% NewTAcc = TAcc#tacc{path = NewPath},
-% Fields = get_text_field_values(Val, NewTAcc),
-% get_text_field_values_obj(Rest, TAcc, Fields ++ FAcc).
-%
-%
-% get_text_field_values_arr([], _, FAcc) ->
-% FAcc;
-% get_text_field_values_arr([Value | Rest], TAcc, FAcc) ->
-% Fields = get_text_field_values(Value, TAcc),
-% get_text_field_values_arr(Rest, TAcc, Fields ++ FAcc).
-%
-%
-% get_default_enabled(Props) ->
-% case couch_util:get_value(<<"default_field">>, Props, {[]}) of
-% Bool when is_boolean(Bool) ->
-% Bool;
-% {[]} ->
-% true;
-% {Opts}->
-% couch_util:get_value(<<"enabled">>, Opts, true)
-% end.
-%
-%
-% get_index_array_lengths(Props) ->
-% couch_util:get_value(<<"index_array_lengths">>, Props, true).
-%
-%
-% add_default_text_field(Fields) ->
-% DefaultFields = add_default_text_field(Fields, []),
-% DefaultFields ++ Fields.
-%
-%
-% add_default_text_field([], Acc) ->
-% Acc;
-% add_default_text_field([{_Name, <<"string">>, Value} | Rest], Acc) ->
-% NewAcc = [{<<"$default">>, <<"string">>, Value} | Acc],
-% add_default_text_field(Rest, NewAcc);
-% add_default_text_field([_ | Rest], Acc) ->
-% add_default_text_field(Rest, Acc).
-%
-%
-% %% index of all field names
-% get_field_names(Fields) ->
-% FieldNameSet = lists:foldl(fun({Name, _, _}, Set) ->
-% gb_sets:add([<<"$fieldnames">>, Name, []], Set)
-% end, gb_sets:new(), Fields),
-% gb_sets:to_list(FieldNameSet).
-%
-%
-% convert_text_fields([]) ->
-% [];
-% convert_text_fields([{Name, _Type, Value} | Rest]) ->
-% [[Name, Value, []] | convert_text_fields(Rest)].
-%
-%
-% should_index(Selector, Doc) ->
-% % We should do this
-% NormSelector = mango_selector:normalize(Selector),
-% Matches = mango_selector:match(NormSelector, Doc),
-% IsDesign = case mango_doc:get_field(Doc, <<"_id">>) of
-% <<"_design/", _/binary>> -> true;
-% _ -> false
-% end,
-% Matches and not IsDesign.
-%
-%
-% get_text_field_list(IdxProps) ->
-% case couch_util:get_value(<<"fields">>, IdxProps) of
-% Fields when is_list(Fields) ->
-% RawList = lists:flatmap(fun get_text_field_info/1, Fields),
-% [mango_util:lucene_escape_user(Field) || Field <- RawList];
-% _ ->
-% all_fields
-% end.
-%
-%
-% get_text_field_info({Props}) ->
-% Name = couch_util:get_value(<<"name">>, Props),
-% Type0 = couch_util:get_value(<<"type">>, Props),
-% if not is_binary(Name) -> []; true ->
-% Type = get_text_field_type(Type0),
-% [iolist_to_binary([Name, ":", Type])]
-% end.
-%
-%
-% get_text_field_type(<<"number">>) ->
-% <<"number">>;
-% get_text_field_type(<<"boolean">>) ->
-% <<"boolean">>;
-% get_text_field_type(_) ->
-% <<"string">>.
-%
-%
-% make_text_field(TAcc, Type, Value) ->
-% FieldName = make_text_field_name(TAcc#tacc.path, Type),
-% Fields = TAcc#tacc.fields,
-% case Fields == all_fields orelse lists:member(FieldName, Fields) of
-% true ->
-% [{FieldName, Type, Value}];
-% false ->
-% []
-% end.
-%
-%
-% make_text_field_name([P | Rest], Type) ->
-% Parts = lists:reverse(Rest, [iolist_to_binary([P, ":", Type])]),
-% Escaped = [mango_util:lucene_escape_field(N) || N <- Parts],
-% iolist_to_binary(mango_util:join(".", Escaped)).
-%
-%
-% validate_index_info(IndexInfo) ->
-% IdxTypes = case module_loaded(dreyfus_index) of
-% true ->
-% [mango_idx_view, mango_idx_text];
-% false ->
-% [mango_idx_view]
-% end,
-% Results = lists:foldl(fun(IdxType, Results0) ->
-% try
-% IdxType:validate_index_def(IndexInfo),
-% [valid_index | Results0]
-% catch _:_ ->
-% [invalid_index | Results0]
-% end
-% end, [], IdxTypes),
-% lists:member(valid_index, Results).