基于Elasticsearch为Postgres提供全文搜索功能的扩展:ZomboDB
jopen
9年前
ZomboDB是一个Postgres扩展,能够基于Elasticsearch创建索引(CREATE INDEX)来为Postgres数据库添加高效的全文搜索功能。
Features
- transaction-safe full-text queries
- managed & used via standard Postgres SQL
- works with tables of any structure
- automatically creates Elasticsearch Mappings supporting most datatypes, including arrays
- nested objects for flexible schemaless sub-documents
- custom full-text query language supporting nearly all of Elasticsearch's search features, including
- boolean operations
- proximity (in and out of order)
- phrases
- wildcards
- fuzzy terms/phrases
- "more like this"
- regular expressions
- inline scripts
- range queries
- query results expansion and index linking
- extremely fast indexing
- record count estimation
- high-performance hit highlighting
- access to Elasticsearch's full set of aggregations
- use whatever method you currently use for talking to Postgres (JDBC, DBI, libpq, etc)
- fairly extensive test suite (NB: in progress of being converted from closed-source version)
Because ZomboDB is a Postgres index type, it "just works" with SELECT, COPY, INSERT, UPDATE, DELETE, and VACUUM statements.
Not to suggest that these things are impossible, but there's a small set of non-features too:
- no scoring
- indexes are not crash-safe/recoverable
- interoperability with various Postgres replication schemes is unknown
- pg_get_indexdef()doesn't correctly quote index options making backup restoration annoying (would require patch to Postgres)
- Postgres HOT updates not supported
- only supports Postgres query plans that choose IndexScans or BitmapIndexScans (the latter is also dependent on sufficient work_mem to avoid Recheck conditions)