You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the record definition wrong, or am I just misunderstanding something?
The text was updated successfully, but these errors were encountered:
Basho-JIRA
changed the title
Dialyzer complains about search_results record.
Dialyzer complains about search_results record. [JIRA: CLIENTS-695]
Dec 24, 2015
riakc.hrl defines search_results like this:
-type search_doc() :: [{binary(), binary()}].
-type search_maxscore() :: float().
-type search_number_found() :: non_neg_integer().
-record(search_results, {
docs :: [search_doc()], %% Result documents
max_score :: float(), %% Maximum score
num_found :: non_neg_integer() %% Number of results
}).
The results record I get back looks like this:
{search_results,
[
{
<<"index_name">>,
[
{
<<"score">>,
<<"3.48490639999999984866e+00">>
},
{
<<"_yz_rb">>,
<<"bucket_type">>
},
{
<<"_yz_rt">>,
<<"bucket_name">>
},
{
<<"_yz_rk">>,
<<"a5680e4664ff480785a50e8324f75384000452410048d33f">>
},
{
<<"_yz_id">>, <<"1_bucket_type_bucket_name_a5680e4664ff480785a50e8324f75384000452410048d33f_30">>
}
]
}
],
3.4849064350128174,
1
}
So, doc is defined as [{binary(), binary()}], but I'm getting back [{binary(), [{binary(), binary()}]}].
Dialyzer complains thusly:
The pattern [{_, Doc}] can never match the type [[{binary(),binary()}]]
where my code looks like:
{ok, Results} = riakc_pb_socket:search(Pid, Index, Query),
[{_, Doc}] = Results#search_results.docs.
Is the record definition wrong, or am I just misunderstanding something?
The text was updated successfully, but these errors were encountered: