Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting up elasticSearch with Postgresql

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

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.

like image 672
David B. Avatar asked Sep 15 '10 09:09

David B.


People also ask

Is Elasticsearch faster than Postgres?

Elasticsearch is faster than Postgres when it comes to searching for data. Elasticsearch is a powerful search engine that is often faster than Postgres when it comes to searching for data. Elasticsearch can be used to search for documents, images, and other data stored in a database.

What is ZomboDB?

ZomboDB is a Postgres extension that enables efficient full-text searching via the use of indexes backed by Elasticsearch.

How does Elasticsearch work with database?

Elasticsearch uses Lucene StandardAnalyzer for indexing for automatic type guessing and more precision. When you use Elasticsearch you store data in JSON document form. Then you query them for retrieval. It is schema-less, using some defaults to index the data unless you provide mapping as per your need.


1 Answers

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

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.

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.

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.

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

like image 60
Eric B. Ridge Avatar answered Dec 03 '22 18:12

Eric B. Ridge