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

Everything is pretty slow #317

Open
irevoire opened this issue Aug 24, 2022 · 5 comments
Open

Everything is pretty slow #317

irevoire opened this issue Aug 24, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@irevoire
Copy link
Member

Description
Hello, I was trying out this super cool demo and noticed everything was pretty slow.
image
As you can see most requests took ~100ms to get to me, while meilisearch was usually able to answer in ~5ms.

From what I see the reason is pretty simple, we're retrieving the entire document when we only need its title and poster.
This means we're downloading 120ko when we actually only need a few ko of data 😒

I guess the fix is pretty simple, you should send a search request that looks like this;

{
  "attributesToHighlight": ["title"],
  "attributesToRetrieve": [],
  // the other fields stay as usual
}

Also, I don't know if it's normal but I can't see the highlighting on my computer, thus maybe we could just remove the attributesToHighlight entirely.

@mdubus
Copy link
Member

mdubus commented Aug 29, 2022

Hello @irevoire 👋

Thanks a lot for opening this issue.

we're retrieving the entire document when we only need its title and poster

I'm not sure I understood correctly what you mean, but we are retrieving the entire document because we need all its fields to display them inside the modal:
Capture d’écran 2022-08-29 à 09 59 15

Therefore, we cannot request just a few fields because we need all of them 🥲

Regarding the highlighting, it's totally normal and it's voluntary not to display it, so I will remove this setting as you suggest 👍

@irevoire
Copy link
Member Author

Oh, ok, I missed this page; I guess the sensible thing to do would be to only query these data when someone clicks on a movie with the /documents/{uid} route. But that's non-trivial 😔

Feel free to close if you don't have the time to look into it.

@mdubus
Copy link
Member

mdubus commented Aug 29, 2022

Thanks a lot @irevoire 🙏

I considered doing this, but this would mean having 2 meilisearch clients to do so:

  • the one of Instant Meilisearch to have this beautiful homepage with the placeholder
  • the one of Meilisearch JS to query a specific movie on click and display it inside the modal

This is completely feasible (I've done it before on the mini-dashboard), but it adds complexity to the project and it's harder to maintain and make evolve.

I'll close this issue (but thanks again for your time investigating and opening this issue!) as I don't really know if this is something we really want to implement and as I don't have the time to dig it now, but we could definitely discuss it again in the future ☺️

@mdubus mdubus closed this as completed Aug 29, 2022
@bidoubiwa
Copy link
Contributor

bidoubiwa commented Aug 30, 2022

If it is slow don't we lose a bit of the purpose of this demo? Since we want to showcase above anything else the speed and relevancy of Meilisearch, if we show slowness it might give the user the idea that we are only relevant but that we are not a fast search engine.

@mdubus
Copy link
Member

mdubus commented Aug 31, 2022

That makes sense, I'll reopen this issue then, but I don't know when I'll have time to work on it 😃

@mdubus mdubus reopened this Aug 31, 2022
@Strift Strift added the enhancement New feature or request label Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants