Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): preserve order when merging semantic and fulltext results #2107

Merged
merged 4 commits into from
Jan 6, 2020

Conversation

lionelB
Copy link
Contributor

@lionelB lionelB commented Dec 30, 2019

this PR

  • update mock data
  • preverse order when merging fulltext results with semantic results

fix #2095, #2152

@lionelB lionelB force-pushed the lionelb/fix-merge-sem-fulltext-results branch from 7ad8413 to 4b696c6 Compare December 30, 2019 21:13
@SocialGroovyBot SocialGroovyBot requested a deployment to staging December 30, 2019 21:33 Abandoned
@lionelB
Copy link
Contributor Author

lionelB commented Dec 31, 2019

wait before merging, need more testing

@lionelB lionelB force-pushed the lionelb/fix-merge-sem-fulltext-results branch from 1b55827 to 48e6ccb Compare January 4, 2020 00:55
@lionelB lionelB merged commit 246b40f into master Jan 6, 2020
@lionelB lionelB deleted the lionelb/fix-merge-sem-fulltext-results branch January 6, 2020 09:15
{}
)
);
const removeDuplicate = (arr, predicate = predicateFn) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a vraiment besoin d'un flatMap ?
Juste un filter avec un some dedans ça me parait un peu plus explicite pour filtrer si on n'a pas de soucis de sous tableaux !

arr.filter(
  (item, index) =>
    !arr.some(
      (subItem, subIndex) =>
        subIndex < index && predicate(item) === predicate(subItem)
    )
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter is ok but I found the some syntax very hard to read

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically the same than .find imho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

position invalide outil préavis de licenciement navigation sticky
4 participants