Skip to content

Commit

Permalink
fix: align the col name for embedding (#76)
Browse files Browse the repository at this point in the history
* fix: align the col name for embedding

Signed-off-by: Keming <[email protected]>

* fix typos lint

Signed-off-by: Keming <[email protected]>

---------

Signed-off-by: Keming <[email protected]>
Co-authored-by: Keming <[email protected]>
kemingy and Keming authored Apr 30, 2024
1 parent 4640115 commit 6198383
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/usage/indexing.md
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ Indexing is the process of building a data structure that allows for efficient s
To construct an index for vectors, first create a table named `items` with a column named `embedding` of type `vector(n)`. Then, populate the table with generated data.

```sql
CREATE TABLE items (val vector(3));
INSERT INTO items (val) SELECT ARRAY[random(), random(), random()]::real[] FROM generate_series(1, 1000);
CREATE TABLE items (embedding vector(3));
INSERT INTO items (embedding) SELECT ARRAY[random(), random(), random()]::real[] FROM generate_series(1, 1000);
```

::: tip
4 changes: 2 additions & 2 deletions src/use-case/sparse-vector.md
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ D_{L2} = \Sigma (x_i - y_i) ^ 2
$$
For sparse vectors, `vector_dot_ops` calculates the dot product, which is a more efficient method.
$$
D_{dot} = - \Sigma x_iy_i
D_{dot} = - \Sigma x_i y_i
$$


@@ -266,4 +266,4 @@ scores = reranker.compute_score([["The text you want to search...", candidate] f
reranked_text = [t for _, t in sorted(zip(scores, mix_text))]
```

Congratulations! We have now completed our first step into the world of sparse vector search.
Congratulations! We have now completed our first step into the world of sparse vector search.
3 changes: 3 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default]
extend-ignore-re = ['\$.+\$']
extend-ignore-identifiers-re = ['\$.+\$']

0 comments on commit 6198383

Please sign in to comment.