How to increase the speed of the search form on the site? At the moment I use sql "like" in the query "search text". The base is large and you need to search by the description of all pages, i.e. each page has the text of ~ 2000 characters, and the number of pages is 150,000. There is a slow search that takes about 10 seconds or more. How can I increase the speed of the query sql.? Or does it depend only on the speed of the server?
- 3every time you search the database using like? it will not be fast on any base. Tried to use something like Sphinx or Apache Solr? - KoVadim
- 3... or ElasticSearch? Or, at worst, the full-text search capabilities of MySQL / PostgreSQL? - D-side
- @KoVadim, but every time I use only like. MySQL database. - Maxim From
|
1 answer
If mysql and myisam base then https://habrahabr.ru/post/40218/ If postgreSQL then http://www.sai.msu.su/~megera/postgres/talks/fts_pgsql_intro.html
There are also ElasticSearch and Sphinx, but these things are for more complex things than full-text search for 1 field.
- I don’t know how to mysql, but postgres can search multi-text in many fields. And you can even assign different weight fields. - Sergey
- @hardworm, and what is for MySQL, what is the way? - Maxim From
- so wrote what. Read and use - hardworm
|