搜索引擎 Lucene 与数据库搜索

发布于 2024-10-11 12:46:33 字数 79 浏览 4 评论 0原文

我正在使用 MySQL 数据库,并且一直在使用数据库驱动的搜索。数据库引擎和Lucene搜索引擎有何优缺点?我想获得有关何时何地使用它们的建议?

I am using a MySQL database and have been using database driven search. Any advantages and disadvantages of database engines and Lucene search engine? I would like to have suggestions about when and where to use them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

汹涌人海 2024-10-18 12:46:33

I suggest you read Full Text Search Engines vs. DBMS. A one-liner would be: If the bulk of your use case is full text search, use Lucene. If the bulk of your use case is joins and other relational operations, use a database. You may use a hybrid solution for a more complicated use case.

梦毁影碎の 2024-10-18 12:46:33

当您想要索引文本文档(任意长度)并在这些文档中搜索文本时,请使用 Lucene,返回与搜索查询匹配的文档的排名列表。 典型的例子是搜索引擎,例如 Google,它使用 Lucene 等文本索引器来索引和查询网页内容。

与 Mysql 等数据库相比,使用 Lucene 来索引和搜索文本的优点是:

这里有很多关于 Lucene 的有用信息

Use Lucene when you want to index textual Documents (of any length) and search for Text within those documents, returning a ranked list of documents that matched the search query. The classic example is search engines, like Google, that uses text indexers like Lucene to index and query the content of web pages.

The advantages of using Lucene over a database like Mysql, for indexing and searching text are:

  • for the developer - tools to analyse, parse and index textual information (e.g. stemming, plurals, synonyms, tokenisation) in multiple languages. Lucene also scales very well for text search.
  • for the user - quality search results. Lucene uses a very good similarity function (to compare the search query against each document), at the heart of which are the Cosine Similarity and Inverse Term/Document frequency. This results in good search results with very little tweaking required upfront.

Lots of useful info on Lucene here.

孤独陪着我 2024-10-18 12:46:33

我们在工作中使用 Sql Server 进行一些使用全文搜索的查询。如果数据量很大,Sql 在全文搜索返回的结果集和查询的其余部分之间进行内部联接,如果数据库在低功率计算机上运行(2GB 内存用于 20 GB 数据),这可能会很慢。将相同的查询切换到 Lucene 可以显着提高速度。

We used Sql Server at work to make some queries which used Fulltext search. In case of big amounts of data Sql makes an inner join between result set returned by FullText search and the rest of the query which might be slow if database is running on the low powered machine (2GB ram for 20 GB of data). Switching the same query to Lucene improved speed considerably.

ら栖息 2024-10-18 12:46:33

Lucene搜索有一个优点就是索引。 这篇文章可以帮助您了解 lucene。

Lucene search has a advantage of indexing. This post can help you understand lucene.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文