Picky returning the same ID multiple times?

6 views
Skip to first unread message

Daniel Doubrovkine

unread,
Jan 24, 2016, 10:12:27 AM1/24/16
to Picky-Ruby
Is it expected that Picky #search returns an ID multiple times?


Thanks!
-dB.


Florian Hanke

unread,
Jan 24, 2016, 11:13:44 AM1/24/16
to picky...@googlegroups.com
Hi Daniel!

Yes, it is expected, as Picky returns each instance of a found ID (in each category). The `#ids` method simply collects the ids from each category (combination).

Use the `unique` option (see below) to only return the first instance of a found ID and ignore ones found in following category (combinations). That should resolve your issue. Please let us know if it doesn't.

Cheers!
   Florian

```
    # This is the main entry point for a query.
    #
    # Parameters:
    # * text:       The search text.
    # * ids = 20:   The amount of ids to calculate (with offset).
    # * offset = 0: The offset from which position to return the ids. Useful for pagination.
    #
    # Options:
    # * unique: Whether to return unique ids.
    #
    # Note: The Rack adapter calls this method after unravelling the HTTP request.
    #
    def search text, ids = 20, offset = 0, options = {}
```

--
You received this message because you are subscribed to the Google Groups "Picky-Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picky-ruby+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Doubrovkine

unread,
Jan 24, 2016, 4:13:24 PM1/24/16
to picky...@googlegroups.com
That worked, thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "Picky-Ruby" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picky-ruby/CStIjDF8IP4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picky-ruby+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Florian Hanke

unread,
Jan 24, 2016, 4:15:29 PM1/24/16
to picky...@googlegroups.com
Great to hear :)
Reply all
Reply to author
Forward
0 new messages