简体   繁体   English

Elasticsearch 优于 mysql 搜索性能

[英]Elasticsearch over mysql search performance

I'm making a website using Symfony 2 and Mysql as DBMS.我正在使用 Symfony 2 和 Mysql 作为 DBMS 制作网站。 Now, the site involves some entities that can be searchable from the home page and the searches can be by term and by location, not the two at the same time.现在,该站点涉及一些可以从主页搜索的实体,并且可以按术语和位置进行搜索,而不是同时进行两者。 The thing is that I installed elasticsearch on my server to index the searchable entities.问题是我在我的服务器上安装了 elasticsearch 来索引可搜索的实体。

Now, does anyone knows the performance advantages of searching between a mysql search and and elasticsearch search?现在,有人知道在 mysql 搜索和 elasticsearch 搜索之间搜索的性能优势吗?

Consider that on the mysql database all searchable fields are indexed using a FULL TEXT index and on the elasticsearch index all fields are indexed to be able to search on them.考虑到在 mysql 数据库上,所有可搜索字段都使用 FULL TEXT 索引编制索引,而在 elasticsearch 索引上,所有字段都编制了索引以便能够对其进行搜索。

In my tests, elasticsearch queries have up to 6x faster than sql queries with mysql and Doctrine.在我的测试中,elasticsearch 查询比使用 mysql 和 Doctrine 的 sql 查询快 6 倍。 But for security part, I have always been keeping all the information backed up in mysql.但出于安全考虑,我一直将所有信息备份在 mysql 中。 As far as I've read this is a common practice.据我所知,这是一种常见的做法。 After almost a year making queries in elasticsearch I feel more comfortable to make complex queries and I find better results with free text inputs.在 elasticsearch 中进行查询将近一年后,我对进行复杂查询感到更自在,并且我发现使用自由文本输入获得更好的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM