With the PHP Riak Client, how would I search two indexes for values simultaneously? -


i have dataset in riak different items indexed (using index_bin). how go searching objects 2 of these indexes have particular values in single request? example: gender, last_name gender = male, , last_name = smith

would use map/reduce? if so, example code?

a limitation of secondary indexes in riak single index can searched @ time. therefore not able directly combine indexes.

as index data stored in metadata of record, create mapreduce job takes 1 2i query input , has map phase filters on other based on metadata. using mapreduce way may quite slow , inefficient data passed map phase function need read disk.

if looking serve reasonably common , predictable request, can create , use composite index instead. e.g. create index named gender_name_bin have values male_smith. allow range query on last part of index long first part fixed, gives flexibility.

it in recent versions possible filter secondary index values based on regular expressions, not require actual object loaded. more information can found here.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -