Skip to content

Commit

Permalink
fix copy buttons on Trigram Indexes page (#19251)
Browse files Browse the repository at this point in the history
  • Loading branch information
taroface authored Dec 19, 2024
1 parent ecf1dbf commit 035d5cd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/current/v23.1/trigram-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,36 @@ For usage examples, see [Use a trigram index to speed up fuzzy string matching](

Suppose you have a table with the following columns:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE TABLE t (a INT, w STRING);
~~~

The following examples illustrate how to create various trigram indexes on column `w`.

A GIN index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops);
~~~

A partial index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops) WHERE a > 0;
~~~

A multi-column index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (a, w gin_trgm_ops);
~~~

An expression index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN ((json_col->>'json_text_field'))
Expand Down
5 changes: 5 additions & 0 deletions src/current/v23.2/trigram-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,36 @@ For usage examples, see [Use a trigram index to speed up fuzzy string matching](

Suppose you have a table with the following columns:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE TABLE t (a INT, w STRING);
~~~

The following examples illustrate how to create various trigram indexes on column `w`.

A GIN index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops);
~~~

A partial index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops) WHERE a > 0;
~~~

A multi-column index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (a, w gin_trgm_ops);
~~~

An expression index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN ((json_col->>'json_text_field'))
Expand Down
5 changes: 5 additions & 0 deletions src/current/v24.1/trigram-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,36 @@ For usage examples, see [Use a trigram index to speed up fuzzy string matching](

Suppose you have a table with the following columns:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE TABLE t (a INT, w STRING);
~~~

The following examples illustrate how to create various trigram indexes on column `w`.

A GIN index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops);
~~~

A partial index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops) WHERE a > 0;
~~~

A multi-column index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (a, w gin_trgm_ops);
~~~

An expression index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN ((json_col->>'json_text_field'))
Expand Down
5 changes: 5 additions & 0 deletions src/current/v24.2/trigram-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,36 @@ For usage examples, see [Use a trigram index to speed up fuzzy string matching](

Suppose you have a table with the following columns:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE TABLE t (a INT, w STRING);
~~~

The following examples illustrate how to create various trigram indexes on column `w`.

A GIN index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops);
~~~

A partial index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops) WHERE a > 0;
~~~

A multi-column index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (a, w gin_trgm_ops);
~~~

An expression index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN ((json_col->>'json_text_field'))
Expand Down
5 changes: 5 additions & 0 deletions src/current/v24.3/trigram-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,36 @@ For usage examples, see [Use a trigram index to speed up fuzzy string matching](

Suppose you have a table with the following columns:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE TABLE t (a INT, w STRING);
~~~

The following examples illustrate how to create various trigram indexes on column `w`.

A GIN index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops);
~~~

A partial index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (w gin_trgm_ops) WHERE a > 0;
~~~

A multi-column index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN (a, w gin_trgm_ops);
~~~

An expression index with trigram matching enabled:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE INDEX ON t USING GIN ((json_col->>'json_text_field'))
Expand Down

0 comments on commit 035d5cd

Please sign in to comment.