Skip to content

Duplicates when using remote and prefetch #103

Open

Description

@jisotalo

Hello

I am using prefetch to obtain most used data. When writing something more results are queried from server with remote option.

If prefetch data contains same items as the remote data, both of them are shown in the list (so they are duplicates).

I tried to Google it but only result is that "dupDetector" should be used like this
dupDetector: function (remoteMatch, localMatch) { return remoteMatch.id === localMatch.id; }

But it seems that there is no dupDetector option available, is that correct? How should I do this?

Activity

  1. jisotalo commented on Nov 27, 2016

    @jisotalo
    Author

    Okay, now I noticed that by using "identify" I am able to filter duplicates out by having data id in my json.
    identify: function(obj) { return obj.id; },

    I suggest that the documentation should contain more information about these.

  2. added this to the v1.1.0 milestone on Nov 30, 2016
  3. modified the milestones: v1.1.0, v1.2.0 on Dec 21, 2016
  4. simplenotezy commented on Jan 9, 2020

    @simplenotezy

    I believe the identify function won't work if you have multiple datasets, and two different datasets have a suggestion that share the same id.

    There should be a way to avoid duplicates across datasets.

  5. ivoytov commented on Jun 11, 2021

    @ivoytov

    I had the same issue and the identify function solved it for me. Just saying thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions