ElasticSearch vs SQL全文搜索

时间:2022-06-20 08:48:52

I want to use full text search in my project... Can anyone explain me, what is the difference between ElasticSearch and SQL Full Text Search

我想在我的项目中使用全文搜索...任何人都可以解释一下,ElasticSearch和SQL全文搜索之间有什么区别

Or

要么

why SQL Full Text Search is better (worse) than elastic?

为什么SQL全文搜索比弹性更好(更差)?

documentations, presentations, schema...

文件,演示文稿,模式......

1 个解决方案

#1


25  

Define "better"... sql full text search is fairly trivial to get working (indexing and query) - but it has penalties:

定义“更好”... sql全文搜索是非常简单的工作(索引和查询) - 但它有惩罚:

  • very little (virtually no) control over how things are indexed (what the index keys are; what the lexers/stemmers/etc are; etc)
  • 很少(几乎没有)控制事物的索引方式(索引键是什么;词法分析器/词干分析器等是什么;等等)
  • runs on the sql server - which is usually your least scalable infrastructure
  • 在SQL服务器上运行 - 这通常是您可扩展性最低的基础架构

Elastic search requires more work; you need to setup and maintain a dedicated cluster of nodes, and then provide code that performs the actual index operations, which may also involve a scheduled job that works from a change-log (processing new / edited data), building the fragments to be indexed; equally, you need to then take more time building the query. But you get a lot of control over the index and query, and scalability (a cluster can be whatever size you need). If it helps any, Stack Overflow grew up on sql full text search, then moved into elastic search when the limitations (both features and performance) proved prohibitive.

弹性搜索需要更多工作;您需要设置和维护一个专用的节点集群,然后提供执行实际索引操作的代码,这些代码操作也可能涉及从更改日志(处理新的/编辑的数据)起作用的预定作业,将片段构建为索引;同样,您需要花费更多时间来构建查询。但是您可以对索引和查询以及可伸缩性(集群可以是您需要的任何大小)进行大量控制。如果它有帮助,Stack Overflow在sql全文搜索上长大,然后在限制(功能和性能)被证明是禁止的时候进入弹性搜索。

#1


25  

Define "better"... sql full text search is fairly trivial to get working (indexing and query) - but it has penalties:

定义“更好”... sql全文搜索是非常简单的工作(索引和查询) - 但它有惩罚:

  • very little (virtually no) control over how things are indexed (what the index keys are; what the lexers/stemmers/etc are; etc)
  • 很少(几乎没有)控制事物的索引方式(索引键是什么;词法分析器/词干分析器等是什么;等等)
  • runs on the sql server - which is usually your least scalable infrastructure
  • 在SQL服务器上运行 - 这通常是您可扩展性最低的基础架构

Elastic search requires more work; you need to setup and maintain a dedicated cluster of nodes, and then provide code that performs the actual index operations, which may also involve a scheduled job that works from a change-log (processing new / edited data), building the fragments to be indexed; equally, you need to then take more time building the query. But you get a lot of control over the index and query, and scalability (a cluster can be whatever size you need). If it helps any, Stack Overflow grew up on sql full text search, then moved into elastic search when the limitations (both features and performance) proved prohibitive.

弹性搜索需要更多工作;您需要设置和维护一个专用的节点集群,然后提供执行实际索引操作的代码,这些代码操作也可能涉及从更改日志(处理新的/编辑的数据)起作用的预定作业,将片段构建为索引;同样,您需要花费更多时间来构建查询。但是您可以对索引和查询以及可伸缩性(集群可以是您需要的任何大小)进行大量控制。如果它有帮助,Stack Overflow在sql全文搜索上长大,然后在限制(功能和性能)被证明是禁止的时候进入弹性搜索。