Skip to content

Commit 5443d4c

Browse files
author
Vladlen Popolitov
committed
README.md updated
1 parent 19aeec7 commit 5443d4c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,32 +94,32 @@ SET anyarray.similarity_type=jaccard;
9494
SET anyarray.similarity_type=overlap;
9595
```
9696

97-
Set threshold for similarity search. Default value is 0.6 . RESET value is 0.0 . anyarray.similarity_threshold accept values from 0.0 to 1e10 .
97+
Set threshold for similarity search. Default value is 0.6 . RESET value is 0.0 . `anyarray.similarity_threshold` accept values from 0.0 to 1e10 .
9898
```
9999
SET anyarray.similarity_threshold = 3;
100100
RESET anyarray.similarity_threshold;
101101
```
102102

103-
RUM version 1.2 and 1.3 used variables rum.array_similarity_function and rum.array_similarity_threshold that are obsolete and replaced by anyarray.similarity_type and anyarray.similarity_threshold.
103+
RUM version 1.2 and 1.3 used variables `rum.array_similarity_function` and `rum.array_similarity_threshold` that are obsolete and replaced by `anyarray.similarity_type` and `anyarray.similarity_threshold`.
104104

105105
Examples
106106
-------
107107

108108
Examples for INTEGER[] .
109109

110110
### Create a table with sample data.
111-
```
111+
```SQL
112112
SELECT t, ARRAY(
113113
SELECT v::int4
114-
FROM generate_series(max(0, t - 10), t) as v
114+
FROM generate_series(GREATEST(0, t - 10), t) as v
115115
) AS v
116116
INTO test_int4
117117
FROM generate_series(1, 200) as t;
118118
```
119119

120120
### Similarity calculation.
121121

122-
```
122+
```SQL
123123
SET anyarray.similarity_type=cosine;
124124
SELECT t, similarity(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4
125125
WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
@@ -148,7 +148,7 @@ RESET anyarray.similarity_threshold;
148148

149149
### Create GIST index.
150150

151-
```
151+
```SQL
152152
CREATE INDEX idx_test_int4 ON test_int4 USING gist (v _int4_aa_ops);
153153

154154
SET enable_seqscan=off;
@@ -177,7 +177,7 @@ DROP INDEX idx_test_int4;
177177

178178
### Create GIN index.
179179

180-
```
180+
```SQL
181181
CREATE INDEX idx_test_int4 ON test_int4 USING gin (v _int4_aa_ops);
182182

183183
SET enable_seqscan=off;
@@ -204,7 +204,7 @@ RESET anyarray.similarity_threshold;
204204

205205
### Create RUM index.
206206

207-
```
207+
```SQL
208208
CREATE INDEX idx_test_int4 ON test_int4 USING rum (v _int4_aa_ops);
209209

210210
SET enable_seqscan=off;
@@ -263,7 +263,7 @@ Operator class names for all types implemented in anyarray.
263263

264264
Install the latest version and run in every database you want to upgrade:
265265

266-
```
266+
```SQL
267267
ALTER EXTENSION anyarray UPDATE;
268268
```
269269
You need to close this database server connection to apply changes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy