Problem/Motivation

We've got a situation where the autocomplete functionality is returning a lot of duplicates. The longer the string is, the more duplicates; in some cases, you can enter something like "opening hours" and get around 5-10 duplicates of "opening hours".

Steps to reproduce

This would depend on your Funnelback installation, and the site/s that it indexes, but entering any sufficiently long search string into a Funnelback-powered search bar with autocomplete might produce duplicates.

Proposed resolution

Apply a change to FunnelbackPageController::getAutocompletionResult that filters out duplicated search suggestions. Something like, say, $results = array_unique(array_map(fn($result) => $result['key'], $results)); to filter down $results to just the list of suggestions.

Remaining tasks

Implement change and test.

User interface changes

None. Reduction of duplicates might mean that users running autocomplete suggestion searches may not receive as many results as are configured in the back end.

API changes

None.

Data model changes

None.

Issue fork funnelback-3438016

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

geoffreyr created an issue. See original summary.

geoffreyr’s picture

Assigned: geoffreyr » Unassigned
Status: Active » Needs review
geoffreyr’s picture

Status: Needs review » Needs work

Doesn't handle boolean results properly. Need to fix.

geoffreyr’s picture

Status: Needs work » Needs review

Ok, looks like I've fixed the exception throwing.

geoffreyr’s picture

Status: Needs review » Fixed

Targetting to 2.0.0-beta4.

  • geoffreyr committed f21242df on 2.x
    Issue #3438016 by geoffreyr, larowlan: Filter duplicates out of...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.