S
S
Sergey Filnor2020-02-14 19:02:03
Search engines
Sergey Filnor, 2020-02-14 19:02:03

How to speed up search in a Laravel project?

Faced the problem of search speed.
When writing the project code, I used a test base, which included about 50k companies.
At the time, everything seemed to be working quite well. The results came in about 1-1.5 seconds.

Now they have poured a product base with 2 million companies and search results come in 15-20 seconds, which by itself is not usable at all.

The structure of the database is as follows:
5e46c1e8707ac915739423.jpeg

Search through one form searches according to 3 criteria (highlighted in purple) - company code, company name (in any language) and product name (in any language).

It seems that there are no complex relationships here, the number of records for MySQL is not particularly serious. The keys in the bases are also placed. ¯\_( ツ)_/¯ I
use Eloquent in the code.

Please let me know what could be the problem and what can be done to fix it.
I want to understand where to dig to speed up, I thought to look towards ElasticSearch or Algolia .
But I would like to know what other alternatives there are to "not shoot sparrows from a cannon"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hostadmin, 2020-02-15
@hostadmin

And the search, I suppose, through LIKE?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question