Skip to content

Commit

Permalink
Update links in more files
Browse files Browse the repository at this point in the history
  • Loading branch information
lilin90 committed Jan 3, 2025
1 parent 76792df commit 9816957
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
- [Date and Time Types](/data-type-date-and-time.md)
- [String Types](/data-type-string.md)
- [JSON Type](/data-type-json.md)
- [Vector Types](/vector-search-data-types.md)
- [Vector Types](/vector-search/vector-search-data-types.md)
- Functions and Operators
- [Overview](/functions-and-operators/functions-and-operators-overview.md)
- [Type Conversion in Expression Evaluation](/functions-and-operators/type-conversion-in-expression-evaluation.md)
Expand All @@ -905,7 +905,7 @@
- [Encryption and Compression Functions](/functions-and-operators/encryption-and-compression-functions.md)
- [Locking Functions](/functions-and-operators/locking-functions.md)
- [Information Functions](/functions-and-operators/information-functions.md)
- [Vector Functions and Operators](/vector-search-functions-and-operators.md)
- [Vector Functions and Operators](/vector-search/vector-search-functions-and-operators.md)
- JSON Functions
- [Overview](/functions-and-operators/json-functions.md)
- [Functions That Create JSON](/functions-and-operators/json-functions/json-functions-create.md)
Expand Down
20 changes: 10 additions & 10 deletions vector-search/vector-search-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following Vector data types are currently available:

Using vector data types provides the following advantages over using the [`JSON`](/data-type-json.md) type:

- Vector index support: You can build a [vector search index](/vector-search-index.md) to speed up vector searching.
- Vector index support: You can build a [vector search index](/vector-search/vector-search-index.md) to speed up vector searching.
- Dimension enforcement: You can specify a dimension to forbid inserting vectors with different dimensions.
- Optimized storage format: Vector data types are optimized for handling vector data, offering better space efficiency and performance compared to `JSON` types.

Expand Down Expand Up @@ -65,9 +65,9 @@ In the following example, because dimension `3` is enforced for the `embedding`
ERROR 1105 (HY000): vector has 2 dimensions, does not fit VECTOR(3)
```

For available functions and operators over the vector data types, see [Vector Functions and Operators](/vector-search-functions-and-operators.md).
For available functions and operators over the vector data types, see [Vector Functions and Operators](/vector-search/vector-search-functions-and-operators.md).

For more information about building and using a vector search index, see [Vector Search Index](/vector-search-index.md).
For more information about building and using a vector search index, see [Vector Search Index](/vector-search/vector-search-index.md).

## Store vectors with different dimensions

Expand All @@ -83,11 +83,11 @@ INSERT INTO vector_table VALUES (1, '[0.3, 0.5, -0.1]'); -- 3 dimensions vector,
INSERT INTO vector_table VALUES (2, '[0.3, 0.5]'); -- 2 dimensions vector, OK
```

However, note that you cannot build a [vector search index](/vector-search-index.md) for this column, as vector distances can be only calculated between vectors with the same dimensions.
However, note that you cannot build a [vector search index](/vector-search/vector-search-index.md) for this column, as vector distances can be only calculated between vectors with the same dimensions.

## Comparison

You can compare vector data types using [comparison operators](/functions-and-operators/operators.md) such as `=`, `!=`, `<`, `>`, `<=`, and `>=`. For a complete list of comparison operators and functions for vector data types, see [Vector Functions and Operators](/vector-search-functions-and-operators.md).
You can compare vector data types using [comparison operators](/functions-and-operators/operators.md) such as `=`, `!=`, `<`, `>`, `<=`, and `>=`. For a complete list of comparison operators and functions for vector data types, see [Vector Functions and Operators](/vector-search/vector-search-functions-and-operators.md).

Vector data types are compared element-wise numerically. For example:

Expand Down Expand Up @@ -231,7 +231,7 @@ You can also explicitly cast a vector to its string representation. Take using t
1 row in set (0.01 sec)
```

For additional cast functions, see [Vector Functions and Operators](/vector-search-functions-and-operators.md).
For additional cast functions, see [Vector Functions and Operators](/vector-search/vector-search-functions-and-operators.md).

### Cast between Vector ⇔ other data types

Expand All @@ -241,14 +241,14 @@ Note that vector data type columns stored in a table cannot be converted to othe

## Restrictions

For restrictions on vector data types, see [Vector search limitations](/vector-search-limitations.md) and [Vector index restrictions](/vector-search-index.md#restrictions).
For restrictions on vector data types, see [Vector search limitations](/vector-search/vector-search-limitations.md) and [Vector index restrictions](/vector-search/vector-search-index.md#restrictions).

## MySQL compatibility

Vector data types are TiDB specific, and are not supported in MySQL.

## See also

- [Vector Functions and Operators](/vector-search-functions-and-operators.md)
- [Vector Search Index](/vector-search-index.md)
- [Improve Vector Search Performance](/vector-search-improve-performance.md)
- [Vector Functions and Operators](/vector-search/vector-search-functions-and-operators.md)
- [Vector Search Index](/vector-search/vector-search-index.md)
- [Improve Vector Search Performance](/vector-search/vector-search-improve-performance.md)
12 changes: 6 additions & 6 deletions vector-search/vector-search-functions-and-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This document lists the functions and operators available for Vector data types.
## Vector functions

The following functions are designed specifically for [Vector data types](/vector-search-data-types.md).
The following functions are designed specifically for [Vector data types](/vector-search/vector-search-data-types.md).

**Vector distance functions:**

Expand All @@ -43,7 +43,7 @@ The following functions are designed specifically for [Vector data types](/vecto

## Extended built-in functions and operators

The following built-in functions and operators are extended to support operations on [Vector data types](/vector-search-data-types.md).
The following built-in functions and operators are extended to support operations on [Vector data types](/vector-search/vector-search-data-types.md).

**Arithmetic operators:**

Expand All @@ -52,7 +52,7 @@ The following built-in functions and operators are extended to support operation
| [`+`](https://dev.mysql.com/doc/refman/8.0/en/arithmetic-functions.html#operator_plus) | Vector element-wise addition operator |
| [`-`](https://dev.mysql.com/doc/refman/8.0/en/arithmetic-functions.html#operator_minus) | Vector element-wise subtraction operator |

For more information about how vector arithmetic works, see [Vector Data Type | Arithmetic](/vector-search-data-types.md#arithmetic).
For more information about how vector arithmetic works, see [Vector Data Type | Arithmetic](/vector-search/vector-search-data-types.md#arithmetic).

**Aggregate (GROUP BY) functions:**

Expand Down Expand Up @@ -84,7 +84,7 @@ For more information about how vector arithmetic works, see [Vector Data Type |
| [`!=`, `<>`](https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html#operator_not-equal) | Not equal operator |
| [`NOT IN()`](https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html#operator_not-in) | Check whether a value is not within a set of values |

For more information about how vectors are compared, see [Vector Data Type | Comparison](/vector-search-data-types.md#comparison).
For more information about how vectors are compared, see [Vector Data Type | Comparison](/vector-search/vector-search-data-types.md#comparison).

**Control flow functions:**

Expand All @@ -102,7 +102,7 @@ For more information about how vectors are compared, see [Vector Data Type | Com
| [`CAST()`](https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#function_cast) | Cast a value as a string or vector |
| [`CONVERT()`](https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#function_convert) | Cast a value as a string |

For more information about how to use `CAST()`, see [Vector Data Type | Cast](/vector-search-data-types.md#cast).
For more information about how to use `CAST()`, see [Vector Data Type | Cast](/vector-search/vector-search-data-types.md#cast).

## Full references

Expand Down Expand Up @@ -289,4 +289,4 @@ The vector functions and the extended usage of built-in functions and operators

## See also

- [Vector Data Types](/vector-search-data-types.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
10 changes: 5 additions & 5 deletions vector-search/vector-search-get-started-using-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ summary: Learn how to quickly develop an AI application that performs semantic s

This tutorial demonstrates how to develop a simple AI application that provides **semantic search** features. Unlike traditional keyword search, semantic search intelligently understands the meaning behind your query and returns the most relevant result. For example, if you have documents titled "dog", "fish", and "tree", and you search for "a swimming animal", the application would identify "fish" as the most relevant result.

Throughout this tutorial, you will develop this AI application using [TiDB Vector Search](/vector-search-overview.md), Python, [TiDB Vector SDK for Python](https://github.com/pingcap/tidb-vector-python), and AI models.
Throughout this tutorial, you will develop this AI application using [TiDB Vector Search](/vector-search/vector-search-overview.md), Python, [TiDB Vector SDK for Python](https://github.com/pingcap/tidb-vector-python), and AI models.

<CustomContent platform="tidb">

Expand Down Expand Up @@ -69,7 +69,7 @@ pip install sqlalchemy pymysql sentence-transformers tidb-vector python-dotenv
```

- `tidb-vector`: the Python client for interacting with TiDB vector search.
- [`sentence-transformers`](https://sbert.net): a Python library that provides pre-trained models for generating [vector embeddings](/vector-search-overview.md#vector-embedding) from text.
- [`sentence-transformers`](https://sbert.net): a Python library that provides pre-trained models for generating [vector embeddings](/vector-search/vector-search-overview.md#vector-embedding) from text.

### Step 3. Configure the connection string to the TiDB cluster

Expand Down Expand Up @@ -135,7 +135,7 @@ The following are descriptions for each parameter:

### Step 4. Initialize the embedding model

An [embedding model](/vector-search-overview.md#embedding-model) transforms data into [vector embeddings](/vector-search-overview.md#vector-embedding). This example uses the pre-trained model [**msmarco-MiniLM-L12-cos-v5**](https://huggingface.co/sentence-transformers/msmarco-MiniLM-L12-cos-v5) for text embedding. This lightweight model, provided by the `sentence-transformers` library, transforms text data into 384-dimensional vector embeddings.
An [embedding model](/vector-search/vector-search-overview.md#embedding-model) transforms data into [vector embeddings](/vector-search/vector-search-overview.md#vector-embedding). This example uses the pre-trained model [**msmarco-MiniLM-L12-cos-v5**](https://huggingface.co/sentence-transformers/msmarco-MiniLM-L12-cos-v5) for text embedding. This lightweight model, provided by the `sentence-transformers` library, transforms text data into 384-dimensional vector embeddings.

To set up the model, copy the following code into the `example.py` file. This code initializes a `SentenceTransformer` instance and defines a `text_to_embedding()` function for later use.

Expand Down Expand Up @@ -247,5 +247,5 @@ Therefore, according to the output, the swimming animal is most likely a fish, o

## See also

- [Vector Data Types](/vector-search-data-types.md)
- [Vector Search Index](/vector-search-index.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
- [Vector Search Index](/vector-search/vector-search-index.md)
12 changes: 6 additions & 6 deletions vector-search/vector-search-get-started-using-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn how to quickly get started with Vector Search in TiDB using SQL s

# Get Started with Vector Search via SQL

TiDB extends MySQL syntax to support [Vector Search](/vector-search-overview.md) and introduce new [Vector data types](/vector-search-data-types.md) and several [vector functions](/vector-search-functions-and-operators.md).
TiDB extends MySQL syntax to support [Vector Search](/vector-search/vector-search-overview.md) and introduce new [Vector data types](/vector-search/vector-search-data-types.md) and several [vector functions](/vector-search/vector-search-functions-and-operators.md).

This tutorial demonstrates how to get started with TiDB Vector Search just using SQL statements. You will learn how to use the [MySQL command-line client](https://dev.mysql.com/doc/refman/8.4/en/mysql.html) to complete the following operations:

Expand Down Expand Up @@ -90,7 +90,7 @@ mysql --comments --host 127.0.0.1 --port 4000 -u root

### Step 2. Create a vector table

When creating a table, you can define a column as a [vector](/vector-search-overview.md#vector-embedding) column by specifying the `VECTOR` data type.
When creating a table, you can define a column as a [vector](/vector-search/vector-search-overview.md#vector-embedding) column by specifying the `VECTOR` data type.

For example, to create a table `embedded_documents` with a three-dimensional `VECTOR` column, execute the following SQL statements using your MySQL CLI:

Expand All @@ -113,7 +113,7 @@ Query OK, 0 rows affected (0.27 sec)

### Step 3. Insert vector embeddings to the table

Insert three documents with their [vector embeddings](/vector-search-overview.md#vector-embedding) into the `embedded_documents` table:
Insert three documents with their [vector embeddings](/vector-search/vector-search-overview.md#vector-embedding) into the `embedded_documents` table:

```sql
INSERT INTO embedded_documents
Expand All @@ -134,7 +134,7 @@ Records: 3 Duplicates: 0 Warnings: 0
>
> This example simplifies the dimensions of the vector embeddings and uses only 3-dimensional vectors for demonstration purposes.
>
> In real-world applications, [embedding models](/vector-search-overview.md#embedding-model) often produce vector embeddings with hundreds or thousands of dimensions.
> In real-world applications, [embedding models](/vector-search/vector-search-overview.md#embedding-model) often produce vector embeddings with hundreds or thousands of dimensions.
### Step 4. Query the vector table
Expand Down Expand Up @@ -191,5 +191,5 @@ Therefore, according to the output, the swimming animal is most likely a fish, o

## See also

- [Vector Data Types](/vector-search-data-types.md)
- [Vector Search Index](/vector-search-index.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
- [Vector Search Index](/vector-search/vector-search-index.md)
2 changes: 1 addition & 1 deletion vector-search/vector-search-improve-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TiDB Vector Search enables you to perform Approximate Nearest Neighbor (ANN) que
## Add vector search index for vector columns

The [vector search index](/vector-search-index.md) dramatically improves the performance of vector search queries, usually by 10x or more, with a trade-off of only a small decrease of recall rate.
The [vector search index](/vector-search/vector-search-index.md) dramatically improves the performance of vector search queries, usually by 10x or more, with a trade-off of only a small decrease of recall rate.

## Ensure vector indexes are fully built

Expand Down
8 changes: 4 additions & 4 deletions vector-search/vector-search-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ summary: Learn how to build and use the vector search index to accelerate K-Near

K-nearest neighbors (KNN) search is the method for finding the K closest points to a given point in a vector space. The most straightforward approach to perform KNN search is a brute force search, which calculates the distance between the given vector and all other vectors in the space. This approach guarantees perfect accuracy, but it is usually too slow for real-world use. Therefore, approximate algorithms are commonly used in KNN search to enhance speed and efficiency.

In TiDB, you can create and use vector search indexes for such approximate nearest neighbor (ANN) searches over columns with [vector data types](/vector-search-data-types.md). By using vector search indexes, vector search queries could be finished in milliseconds.
In TiDB, you can create and use vector search indexes for such approximate nearest neighbor (ANN) searches over columns with [vector data types](/vector-search/vector-search-data-types.md). By using vector search indexes, vector search queries could be finished in milliseconds.

<CustomContent platform="tidb">

Expand Down Expand Up @@ -39,7 +39,7 @@ Currently, TiDB supports the [HNSW (Hierarchical Navigable Small World)](https:/

[HNSW](https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world) is one of the most popular vector indexing algorithms. The HNSW index provides good performance with relatively high accuracy, up to 98% in specific cases.

In TiDB, you can create an HNSW index for a column with a [vector data type](/vector-search-data-types.md) in either of the following ways:
In TiDB, you can create an HNSW index for a column with a [vector data type](/vector-search/vector-search-data-types.md) in either of the following ways:

- When creating a table, use the following syntax to specify the vector column for the HNSW index:

Expand Down Expand Up @@ -259,5 +259,5 @@ See [`EXPLAIN`](/sql-statements/sql-statement-explain.md), [`EXPLAIN ANALYZE`](/

## See also

- [Improve Vector Search Performance](/vector-search-improve-performance.md)
- [Vector Data Types](/vector-search-data-types.md)
- [Improve Vector Search Performance](/vector-search/vector-search-improve-performance.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
6 changes: 3 additions & 3 deletions vector-search/vector-search-integrate-with-django-orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn how to integrate TiDB Vector Search with Django ORM to store embe

# Integrate TiDB Vector Search with Django ORM

This tutorial walks you through how to use [Django](https://www.djangoproject.com/) ORM to interact with the [TiDB Vector Search](/vector-search-overview.md), store embeddings, and perform vector search queries.
This tutorial walks you through how to use [Django](https://www.djangoproject.com/) ORM to interact with the [TiDB Vector Search](/vector-search/vector-search-overview.md), store embeddings, and perform vector search queries.

<CustomContent platform="tidb">

Expand Down Expand Up @@ -276,5 +276,5 @@ results = Document.objects.annotate(

## See also

- [Vector Data Types](/vector-search-data-types.md)
- [Vector Search Index](/vector-search-index.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
- [Vector Search Index](/vector-search/vector-search-index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,5 @@ with Session(engine) as session:

## See also

- [Vector Data Types](/vector-search-data-types.md)
- [Vector Search Index](/vector-search-index.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
- [Vector Search Index](/vector-search/vector-search-index.md)
6 changes: 3 additions & 3 deletions vector-search/vector-search-integrate-with-langchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn how to integrate TiDB Vector Search with LangChain.

# Integrate Vector Search with LangChain

This tutorial demonstrates how to integrate the [vector search](/vector-search-overview.md) feature of TiDB with [LangChain](https://python.langchain.com/).
This tutorial demonstrates how to integrate the [vector search](/vector-search/vector-search-overview.md) feature of TiDB with [LangChain](https://python.langchain.com/).

<CustomContent platform="tidb">

Expand Down Expand Up @@ -650,5 +650,5 @@ The expected output is as follows:

## See also

- [Vector Data Types](/vector-search-data-types.md)
- [Vector Search Index](/vector-search-index.md)
- [Vector Data Types](/vector-search/vector-search-data-types.md)
- [Vector Search Index](/vector-search/vector-search-index.md)
Loading

0 comments on commit 9816957

Please sign in to comment.