MySQL的5.6全文搜索VS ElasticSearch我的ASP.NET 4.5 Web应用程序 [英] MySQL 5.6 Full Text Search vs ElasticSearch for my ASP.NET 4.5 Web App

查看:312
本文介绍了MySQL的5.6全文搜索VS ElasticSearch我的ASP.NET 4.5 Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立在ASP.NET 4.5 C#的Web应用程序。我的应用程序将严重依赖于搜索功能。我在寻找我的项目一个高性能的搜索解决方案。我在看一个是效率/快,易于实现。

I am building a web application in ASP.NET 4.5 C#. My app will be heavily relied on searching capabilities. I am searching for a high-performing searching solution for my project. I am looking at one that is efficient / fast and easy to implement.

将在几个解决方案之后,我发现ElasticSearch提供出色的搜索功能,以及它是由Amazon Web Services的支持,如果我决定在那里部署我的项目。

After going over a few solution, I found ElasticSearch to offer excellent searching capabilities, as well it's supported by Amazon Web Services if I decide to deploy my project there.

不过,我读过的MySQL 5.6现在拥有全文搜索福尔InnoDB表。我想知道其中的差别,缺点和每种方法的利弊,以决定在我的下一个项目使用哪一个。

However, I've read that MySQL 5.6 now features Full Text Search foor InnoDB tables. I wanted to know the difference, cons and pros of each approach in order to decide which one to use in my next project.

我的主要目标:能够做出非常快的检索针对我的数据库,并享受我实际上将有我的搜索文本字段的100个字符非常小的文本字段自然语言搜索,得分等所带来的好处。

My main goal: being able to make very fast searches against my database and enjoy the benefits of natural language search, scoring, etc. I will actually have very small text fields of 100 characters for my searchable text fields.

我的问题总结:


  1. 什么是MySQL 5.6全文搜索和ElasticSearch的foundemental区别? (优缺点)

  2. 使用MySQL的全文搜索,我需要搜索索引/功能从数据库(,分开例如用ElasticSearch我使用,我可以在不同的服务器上部署ELasticSearch服务器。我不知道这工作原理相同与MySQL全文搜索吗?

  3. 哪一个更容易实现?

  4. 有没有使用无论是在ASP.NET项目的任何好处(如支持客户端库,等等。)

感谢。

推荐答案

我不是很熟悉的MySQL 5.6全文搜索功能,但我在我的ASP.NET Web应用程序使用ElasticSearch。

I'm not very familiar with MySQL 5.6 Full Text Search capabilities, but I'm using ElasticSearch in my ASP.NET Web App.


  1. 的MySQL查询SQL中,ES是JSON质疑,因为它是基于REST

  1. MySQL is queried in SQL, ES is queried in JSON, as it is RESTful

虽然MySQL是数据库管理系统本身,ElasticSearch只有一个搜索引擎。在其上执行搜索存储在它的指数数据(ElasticSearch数据存储被称为索引)。该指数有时喜欢失败,然后你需要有你的数据备份了一些外部数据库(我使用的NoSQL解决方案 - MongoDB的,因为我和BigData问题纠缠),从中你恢复它

While MySQL is database management system itself, ElasticSearch is only a search engine. The data on which search is performed is stored in it's index (ElasticSearch data store is called index). This index sometimes likes to fail, and then you need to have your data backuped in some external database (I'm using NoSQL solution - MongoDB, as I struggle with BigData problem), from which you restore it.

ElasticSearch的分布式系统。它采用碎片 - 当你执行搜索,索引分裂成碎片,这是由单独的线程独立搜索的数量。然后,搜索结果被合并为一组。如得分是基于对在其上执行的搜索的记录数某种方式计算的,它可以是用于根据相同的记录在其上的碎片是与多少记录被分配给此碎片(虽然它是在搜索查询选项可配置不同 - 见DFSThenFetch)

ElasticSearch is distributed system. It uses Shards - when you perform search, the index is splitted into number of shards, which are searched independently by separate threads. Then search results are consolidated into one set. As scoring is calculated in some way based on number of records on which search is performed, it may be different for the same record depending on which shard it was and how many records were assigned to this shard (although it is configurable in search query options - see DFSThenFetch)

ES可与C#code。通过(利用前pressions更多利用NEST库,它可以让你ES实体映射成C#类和LINQ查询它们,通过lambda语法互动超过predicates)

ES can be interacted with from C# code by using by NEST library, which allows you to map ES entities into C# classes and query them by LINQ, by lambda syntax (utilizing expressions more than predicates)

查询ElasticSearch可以pretty具有挑战性的,如果你的实体有许多领域。在我而言,我不得不实施pretty复杂的查询生成器,因为有对ElasticSearch进行搜索查询非常多的方式 - 看<一个href=\"http://www.elasticsearch.org/guide/reference/query-dsl/\">http://www.elasticsearch.org/guide/reference/query-dsl/ (所有的查询类型在NEST库中实现)。您查询pretty不同的匹配字符串,比过滤数据,例如。 GREATERTHAN或LessOEqual。

Querying ElasticSearch can be pretty challenging if your entities have many fields. In my case I had to implement a pretty complex Query builder, as there is very many ways of performing searching query on ElasticSearch - see http://www.elasticsearch.org/guide/reference/query-dsl/ (all those query types are implemented in NEST library). You query pretty differently for matching string, than filtering data, eg. GreaterThan or LessOEqual.

ES允许您根据Levenshtein距离,用错别字挣扎时,这是对莱蒂很好的利用模糊匹配。

ES allows you to utilize fuzzy matching based on Levenshtein Distance, which is p retty nice when struggling with typos.

ElasticSearch是非常,非常快。其中,MS SQL Server的搜索我的数据(通过简单的查询)超过1分钟,ES在不到20毫秒这样做(即使使用非常复杂的查询)。它分布实施Lucene搜索引擎。

ElasticSearch is very, very fast. Where MS SQL Server searched my data (by simple query) for more than 1 minute, ES is doing it in less than 20 ms (even by using very complex query). It is distributed implementation of Lucene search engine.

我知道我的职位是不是直接回答你的问题,但我希望它为您提供有关ElasticSearch一些信息,帮助您以任何方式。干杯。

I know my post is not straight answer to your questions, but I hope it provides you some info concerning ElasticSearch, and helps you in any way. Cheers.

这篇关于MySQL的5.6全文搜索VS ElasticSearch我的ASP.NET 4.5 Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆