smlar
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1850 | smlar | No | Yes | No | Yes | No | Yes | - |
fix pg18 break issue by https://github.com/Vonng/smlar, no valid license, distribution suspend
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | smlar | - |
| RPM | PIGSTY | 1.0 | 1817161514 | smlar_$v | - |
| DEB | PIGSTY | 1.0 | 1817161514 | postgresql-$v-smlar | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0 el8.x86_64.pg18 : smlar_18 smlar_18-1.0-2PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg17 : smlar_17 smlar_17-1.0-2PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg16 : smlar_16 smlar_16-1.0-2PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg15 : smlar_15 smlar_15-1.0-2PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg14 : smlar_14 smlar_14-1.0-2PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.0 el8.aarch64.pg18 : smlar_18 smlar_18-1.0-2PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg17 : smlar_17 smlar_17-1.0-2PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg16 : smlar_16 smlar_16-1.0-2PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg15 : smlar_15 smlar_15-1.0-2PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg14 : smlar_14 smlar_14-1.0-2PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.0 el9.x86_64.pg18 : smlar_18 smlar_18-1.0-2PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg17 : smlar_17 smlar_17-1.0-2PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg16 : smlar_16 smlar_16-1.0-2PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg15 : smlar_15 smlar_15-1.0-2PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg14 : smlar_14 smlar_14-1.0-2PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.0 el9.aarch64.pg18 : smlar_18 smlar_18-1.0-2PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg17 : smlar_17 smlar_17-1.0-2PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg16 : smlar_16 smlar_16-1.0-2PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg15 : smlar_15 smlar_15-1.0-2PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg14 : smlar_14 smlar_14-1.0-2PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.0 el10.x86_64.pg18 : smlar_18 smlar_18-1.0-2PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg17 : smlar_17 smlar_17-1.0-2PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg16 : smlar_16 smlar_16-1.0-2PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg15 : smlar_15 smlar_15-1.0-2PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg14 : smlar_14 smlar_14-1.0-2PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.0 el10.aarch64.pg18 : smlar_18 smlar_18-1.0-2PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg17 : smlar_17 smlar_17-1.0-2PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg16 : smlar_16 smlar_16-1.0-2PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg15 : smlar_15 smlar_15-1.0-2PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg14 : smlar_14 smlar_14-1.0-2PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.0 d12.x86_64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.0 d12.aarch64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.0 d13.x86_64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.0 d13.aarch64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.0 u22.x86_64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.0 u22.aarch64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.0 u24.x86_64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.0 u24.aarch64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.0 u26.x86_64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.0 u26.aarch64.pg18 : postgresql-18-smlar postgresql-18-smlar_1.0-2PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg17 : postgresql-17-smlar postgresql-17-smlar_1.0-2PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg16 : postgresql-16-smlar postgresql-16-smlar_1.0-2PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg15 : postgresql-15-smlar postgresql-15-smlar_1.0-2PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg14 : postgresql-14-smlar postgresql-14-smlar_1.0-2PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for smlar using pig build:
Install
You can install smlar directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
smlar: Effective similarity search for PostgreSQL arrays. Source: README
The smlar extension provides effective similarity search on PostgreSQL arrays using configurable similarity formulas, GiST and GIN index support, and TF/IDF weighting.
Functions
Computes similarity of two arrays. Arrays should be the same type.
Computes similarity of two arrays of composite types. Composite type looks like:
The useIntersect option points to use only intersected elements in the denominator.
Computes similarity of two arrays by a given formula. Predefined variables in formula:
N.i– number of common elements in both arrays (intersection)N.a– number of unique elements in first arrayN.b– number of unique elements in second array
Example:
Returns true if similarity of the arrays is greater than the threshold limit.
Transforms tsvector type to text array.
Sort and unique array.
Returns zero if second argument does not present in the first one and 1.0 in opposite case.
Returns fourth argument if second argument does not present in the first one and third argument in opposite case.
GUC Configuration Variables
Arrays with similarity lower than threshold are not similar by % operation.
Cache of global stat is stored in transaction-independent memory.
Type of similarity formula: cosine (default), tfidf, overlap.
Name of table storing set-wide statistic. Table should be defined as:
A row with null value means total number of documents. Used only for smlar.type = 'tfidf'.
Calculation method for term frequency. Values:
"n"– simple counting of entries (default)"log"– 1 + log(n)"const"– TF is equal to 1
Used only for smlar.type = 'tfidf'.
If false (default), calculate idf as log(d/df). If true, as log(1+d/df). Used only for smlar.type = 'tfidf'.
It is highly recommended to add to postgresql.conf:
GiST/GIN Index Support
The % and && operations are supported with GiST and GIN indexes for many array types:
| Array Type | GIN operator class | GiST operator class |
|---|---|---|
bit[] | _bit_sml_ops | |
bytea[] | _bytea_sml_ops | _bytea_sml_ops |
char[] | _char_sml_ops | _char_sml_ops |
cidr[] | _cidr_sml_ops | _cidr_sml_ops |
date[] | _date_sml_ops | _date_sml_ops |
float4[] | _float4_sml_ops | _float4_sml_ops |
float8[] | _float8_sml_ops | _float8_sml_ops |
inet[] | _inet_sml_ops | _inet_sml_ops |
int2[] | _int2_sml_ops | _int2_sml_ops |
int4[] | _int4_sml_ops | _int4_sml_ops |
int8[] | _int8_sml_ops | _int8_sml_ops |
interval[] | _interval_sml_ops | _interval_sml_ops |
macaddr[] | _macaddr_sml_ops | _macaddr_sml_ops |
money[] | _money_sml_ops | |
numeric[] | _numeric_sml_ops | _numeric_sml_ops |
oid[] | _oid_sml_ops | _oid_sml_ops |
text[] | _text_sml_ops | _text_sml_ops |
time[] | _time_sml_ops | _time_sml_ops |
timestamp[] | _timestamp_sml_ops | _timestamp_sml_ops |
timestamptz[] | _timestamptz_sml_ops | _timestamptz_sml_ops |
timetz[] | _timetz_sml_ops | _timetz_sml_ops |
varbit[] | _varbit_sml_ops | |
varchar[] | _varchar_sml_ops | _varchar_sml_ops |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)