使用 Postgresql 设置 elasticSearch

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3716272/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-20 00:17:14  来源:igfitidea点击:

setting up elasticSearch with Postgresql

databasepostgresqlsearch

提问by David B.

where do I find a howto to set up elasticSearch using Postgres?

我在哪里可以找到使用 Postgres 设置 elasticSearch 的方法?

My field sizes will be about 350mb, yes, MB, each in size. I have a text output of all of the US Code and all decisions from all the courts, the Statutes at Large, pretty much everything you would find in a library, and I need to be able to do full text searches and return the exact point in the field to the app to return the exact page in PDF form. Postgres can easily handle the datastore, but I've never used elasticSearch and have no idea of how it integrates into the indexing, etc.

我的字段大小约为 350mb,是的,MB,每个大小。我有所有美国法典和所有法院的所有判决的文本输出,一般法规,几乎所有你可以在图书馆找到的东西,我需要能够进行全文搜索并返回确切的点在应用程序的字段中以 PDF 形式返回准确的页面。Postgres 可以轻松处理数据存储,但我从未使用过 elasticSearch,也不知道它如何集成到索引等中。

回答by Eric B. Ridge

As of 2015, there's ZomboDB (https://github.com/zombodb/zombodb). As the author, I'm a bit biased, but it's quite powerful. ;)

截至 2015 年,有 ZomboDB ( https://github.com/zombodb/zombodb)。作为作者,我有点偏见,但它非常强大。;)

It's a Postgres extension and Elasticsearch plugin that allows you to "CREATE INDEX"s that use a remote Elasticsearch cluster, and it exposes a fairly powerful query language for performing full-text searches.

它是一个 Postgres 扩展和 Elasticsearch 插件,允许您使用远程 Elasticsearch 集群“创建索引”,并且它公开了一种相当强大的查询语言来执行全文搜索。

Because it's an actual index in Postgres, the ES cluster is automatically synchronized as you INSERT/UPDATE/DELETE records. As such, there's no need for asynchronous synchronization processes.

因为它是 Postgres 中的实际索引,所以 ES 集群会在您 INSERT/UPDATE/DELETE 记录时自动同步。因此,不需要异步同步过程。

Additionally, because it's an actual index, it is transaction-safe, which means concurrent Postgres sessions will only see results that are consistent with their current transaction.

此外,因为它是一个实际索引,所以它是事务安全的,这意味着并发 Postgres 会话只会看到与其当前事务一致的结果。

Here's a linkto ZomboDB's tutorial. It should give you an idea of how easy ZomboDB is to use.

这是ZomboDB 教程的链接。它应该让您了解 ZomboDB 是多么容易使用。

回答by aeupinhere

There is an application that you can use to import SQL Server, Oracle, Postgresql MySQL, etc. in to an ElasticSearch index.

有一个应用程序可用于将 SQL Server、Oracle、Postgresql MySQL 等导入 ElasticSearch 索引。

http://code.google.com/p/ogr2elasticsearch/

http://code.google.com/p/ogr2elasticsearch/

Please let me know if you have any trouble building or using it. ~Adam

如果您在构建或使用它时遇到任何问题,请告诉我。~亚当

回答by ppearcy

Right now, I don't believe there is out of the box integration. You would need to write some glue code to pull data from SQL and submit it into elasticsearch (or vice versa).

现在,我不相信有开箱即用的集成。您需要编写一些胶水代码来从 SQL 中提取数据并将其提交到 elasticsearch(反之亦然)。

I'd recommend asking on the google groups elastic search forum: http://groups.google.com/a/elasticsearch.com/group/users/topics?pli=1

我建议在谷歌群组弹性搜索论坛上提问:http: //groups.google.com/a/elasticsearch.com/group/users/topics?pli=1

Shay Banon, the main contributor/maintainer is extremely helpful.

主要贡献者/维护者 Shay Banon 非常有帮助。

Best Regards, Paul

最好的问候,保罗