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
@developerworks It's certainly possible to implement this in the adapter.
When we're querying by anything other than the ID, we're using the Solr interface instead of the KV interface. And Solr does support specifying the fields we want to retrieve. This is supported in riak_pb_socket.search/6 search option fl (field list):
When querying via the KV interface, we always get the complete map from the database. But we can still respect the select to filter the fields to consider when building the Ecto.Schema struct.
To support specifying a subset of fields to be retrieved, we would have to properly handle Ecto.Query in Riak.Ecto.NormalizedQuery.all/2 and make sure it's passed down to the point where we pull the data from Riak.
Activity
developerworks commentedon Apr 27, 2016
I guess that riak is unstructured and object(
map data type) as a whole to save, it's difficult to select individual columns from query, right?pma commentedon Apr 27, 2016
@developerworks It's certainly possible to implement this in the adapter.
When we're querying by anything other than the ID, we're using the Solr interface instead of the KV interface. And Solr does support specifying the fields we want to retrieve. This is supported in
riak_pb_socket.search/6search optionfl(field list):When querying via the KV interface, we always get the complete map from the database. But we can still respect the
selectto filter the fields to consider when building the Ecto.Schema struct.developerworks commentedon Apr 28, 2016
You means, if i want to specifying the fields we want to retrieve, i must use the
:riakc_pb_socket.search/6functions ?pma commentedon May 1, 2016
@developerworks The call to is done here: https://github.com/pma/riak_ecto/blob/master/lib/riak/connection.ex#L74
To support specifying a subset of fields to be retrieved, we would have to properly handle Ecto.Query in Riak.Ecto.NormalizedQuery.all/2 and make sure it's passed down to the point where we pull the data from Riak.