0

I am having a problem with multiple field search in ydn-db. The problem is actually the same problem which mentioned here:

YDN-DB - Incorrect results using mixed data types with SortedMerge

So the user can choose multiple filter options from the form, and one of the options is the price range of the product (minimum and maximum price). The problem is filtering of range doesn't work for the sorted merge method. My question is what is the best way to implement such filter, and, is there any possibility to make range filter work for sorted merge method?

Community
  • 1
  • 1

1 Answers1

1

Index-base filtering for more than one range is not possible, but planned. Currently you will have to use in-memory sorting (with paging to temp db) using ydn.structs.Buffer. It is unfinished and undocumented.

You can use ydn.db.algo.Zigzag for single key range query and sorting.

Kyaw Tun
  • 12,447
  • 10
  • 56
  • 83
  • thanks for the answer! looking forward about the future of the ydn! I would also like to filter with '!=' operator. I try to create new index iterator by `new ydn.db.IndexIterator.where('product', 'category', '!=', 'phone')` but `IndexIterator` doesn't support `!=` operator. How can I do such filter? – user3995607 Aug 31 '14 at 23:46