Skip to content

Ability to filter out duplicates with union #2173

@youradds

Description

@youradds

I'm using the union feature in multi_search so that we can effectively do an "OR" search with multiple keywords/ phrases in one go. That works well - but the issue I'm having is that it duplicates a lot of stuff. Lets say I have 2 records:


ID: 1
title: test computer man

ID: 2
title computer geek

When I do a mutli_search for "geek" and "computer" and "man" (so 3 searches), I get 4 results - 2 for "computer" and 1 for "geek". and 1 for "man". So what I'm proposing is the ability to de-dupe them. Currently, I'm doing it in my perl code with :

        foreach (@{$results->{hits}}) {
            next if $seen_links->{$_->{document}->{id}};

            $seen_links->{$_->{document}->{id}} = 1;

            push @link_ids, $_->{document}->{id};

        }

But that obviously doesn't work super well - as it messes up the "per page" limit due to removing some of the records

Hopefully that makes sense!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions