Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sq/aggregations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ An aggregation query allows you to perform the following actions:
- Group data based on field values.
- Apply aggregation functions on the grouped data.

This article explains the basic usage of the `FT.AGGREGATE` command. For further details, see the [command specification](https://redis.io/commands/ft.aggregate/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) and the [aggregations reference documentation](https://redis.io/docs/interact/search-and-query/advanced-concepts/aggregations?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).
This article explains the basic usage of the `FT.AGGREGATE` command. For further details, see the [command specification](https://redis.io/commands/ft.aggregate/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) and the [aggregations reference documentation](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/aggregations?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).

The examples in this article use a schema with the following fields:

Expand Down Expand Up @@ -49,7 +49,7 @@ FT.AGGREGATE index "query_expr" LOAD n "field_1" .. "field_n" APPLY "function_ex

Here is a more detailed explanation of the query syntax:

1. **Query expression**: you can use the same query expressions as you would use with the `FT.SEARCH` command. You can substitute `query_expr` with any of the expressions explained in the articles of this [query topic](https://redis.io/docs/interact/search-and-query/query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials). Vector search queries are an exception. You can't combine a vector search with an aggregation query.
1. **Query expression**: you can use the same query expressions as you would use with the `FT.SEARCH` command. You can substitute `query_expr` with any of the expressions explained in the articles of this [query topic](https://redis.io/docs/latest/develop/ai/search-and-query/query/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials). Vector search queries are an exception. You can't combine a vector search with an aggregation query.
2. **Loaded fields**: if field values weren't already loaded into the aggregation pipeline, you can force their presence via the `LOAD` clause. This clause takes the number of fields (`n`), followed by the field names (`"field_1" .. "field_n"`).
3. **Mapping function**: this mapping function operates on the field values. A specific field is referenced as `@field_name` within the function expression. The result is returned as `result_field`.

Expand All @@ -73,7 +73,7 @@ FT.AGGREGATE index "query_expr" ... GROUPBY n "field_1" .. "field_n" REDUCE AGG
Here is an explanation of the additional constructs:

1. **Grouping**: you can group by one or many fields. Each ordered sequence of field values then defines one group. It's also possible to group by values that resulted from a previous `APPLY ... AS`.
2. **Aggregation**: you must replace `AGG_FUNC` with one of the supported aggregation functions (e.g., `SUM` or `COUNT`). A complete list of functions is available in the [aggregations reference documentation](https://redis.io/docs/interact/search-and-query/advanced-concepts/aggregations?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials). Replace `aggregated_result_field` with a value of your choice.
2. **Aggregation**: you must replace `AGG_FUNC` with one of the supported aggregation functions (e.g., `SUM` or `COUNT`). A complete list of functions is available in the [aggregations reference documentation](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/aggregations?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials). Replace `aggregated_result_field` with a value of your choice.

The following query shows you how to group by the field `condition` and apply a reduction based on the previously derived `price_category`. The expression `@price<1000` causes a bicycle to have the price category `1` if its price is lower than 1000 USD. Otherwise, it has the price category `0`. The output is the number of affordable bicycles grouped by price category.

Expand Down
4 changes: 2 additions & 2 deletions src/sq/combined.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A combined query is a combination of several query types, such as:
You can use logical query operators to combine query expressions for numeric, tag, and text fields. For vector fields, you can combine a KNN query with a pre-filter.

**Note**:
The operators are interpreted slightly differently depending on the query dialect used. The default dialect is `DIALECT 1`; see [this article](https://redis.io/docs/interact/search-and-query/advanced-concepts/dialects/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) for information on the various dialects and how to change the dialect version. This article uses the second version of the query dialect, `DIALECT 2`, and uses additional brackets (`(...)`) to help clarify the examples.
The operators are interpreted slightly differently depending on the query dialect used. The default dialect is `DIALECT 1`; see [this article](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/dialects/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) for information on the various dialects and how to change the dialect version. This article uses the second version of the query dialect, `DIALECT 2`, and uses additional brackets (`(...)`) to help clarify the examples.

The examples in this article use the following schema:

Expand Down Expand Up @@ -134,4 +134,4 @@ FT.SEARCH idx:bicycle "@price:[500 1000] -@condition:{new}"
FT.SEARCH index "expr" FILTER numeric_field start end
```

Please see the [range query article](https://redis.io/docs/interact/search-and-query/query/range?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) to learn more about numeric range queries and such filters.
Please see the [range query article](https://redis.io/docs/latest/develop/ai/search-and-query/query/range?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) to learn more about numeric range queries and such filters.
6 changes: 3 additions & 3 deletions src/sq/full-text.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
A full-text search finds words or phrases within larger texts. You can search within a specific text field or across all text fields.

This article provides a good overview of the most relevant full-text search capabilities. Please find further details about all the full-text search features in the [reference documentation](https://redis.io/docs/interact/search-and-query/advanced-concepts/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).
This article provides a good overview of the most relevant full-text search capabilities. Please find further details about all the full-text search features in the [reference documentation](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).

The examples in this article use a schema with the following fields:

Expand Down Expand Up @@ -50,7 +50,7 @@ Instead of searching across all text fields, you might want to limit the search
FT.SEARCH index "@field: word"
```

Words that occur very often in natural language, such as `the` or `a` for the English language, aren't indexed and will not return a search result. You can find further details in the [stop words article](https://redis.io/docs/interact/search-and-query/advanced-concepts/stopwords?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).
Words that occur very often in natural language, such as `the` or `a` for the English language, aren't indexed and will not return a search result. You can find further details in the [stop words article](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/stopwords?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).

The following example searches for all bicycles that have the word 'kids' in the description:

Expand All @@ -60,7 +60,7 @@ FT.SEARCH idx:bicycle "@description: kids"

## Phrase

A phrase is a sentence, sentence fragment, or small group of words. You can find further details about how to find exact phrases in the [exact match article](https://redis.io/docs/interact/search-and-query/query/exact-match?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).
A phrase is a sentence, sentence fragment, or small group of words. You can find further details about how to find exact phrases in the [exact match article](https://redis.io/docs/latest/develop/ai/search-and-query/query/exact-match?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials).


## Word prefix
Expand Down
4 changes: 2 additions & 2 deletions src/sq/learn-more.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Documentation

* [Redis Query Engine home](https://redis.io/docs/interact/search-and-query/?utm_source=redisinsight&utm_medium=app&utm_campaign=query_engine_tutorial)
* [Redis Query Engine home](https://redis.io/docs/latest/develop/ai/search-and-query/?utm_source=redisinsight&utm_medium=app&utm_campaign=query_engine_tutorial)
* [Best practices for scalable Redis Query Engine](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices/?utm_source=redisinsight&utm_medium=app&utm_campaign=tutorials)

### Redis University
Expand All @@ -18,4 +18,4 @@

### Tutorials

* [Examples](https://redis.io/docs/interact/search-and-query/query/?utm_source=redisinsight&utm_medium=app&utm_campaign=query_engine_tutorial)
* [Examples](https://redis.io/docs/latest/develop/ai/search-and-query/query/?utm_source=redisinsight&utm_medium=app&utm_campaign=query_engine_tutorial)
2 changes: 1 addition & 1 deletion src/sq/range.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ FT.SEARCH idx:bicycle "@price:[-inf 2000]" SORTBY price LIMIT 0 5

## Non-numeric range queries

You can learn more about non-numeric range queries, such as [geospatial](https://redis.io/docs/interact/search-and-query/query/geo-spatial?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) or [vector search](https://redis.io/docs/interact/search-and-query/query/vector-search?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) queries, in their dedicated articles.
You can learn more about non-numeric range queries, such as [geospatial](https://redis.io/docs/latest/develop/ai/search-and-query/query/geo-spatial/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) or [vector search](https://redis.io/docs/latest/develop/ai/search-and-query/query/vector-search/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) queries, in their dedicated articles.
2 changes: 1 addition & 1 deletion src/vss/vectors-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This vector index attribute is broken down as follows:
- `DIM 3` means that each vector is three dimensional.
- The `DISTANCE_METRIC` is defined as `COSINE`. Other possible values are `IP` and `L2`.

See the [vector reference](https://redis.io/docs/interact/search-and-query/advanced-concepts/vectors/) for more detailed information about each available option.
See the [vector reference](https://redis.io/docs/latest/develop/ai/search-and-query/vectors/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials) for more detailed information about each available option.

```redis Load some data
JSON.SET user:1 $ '{"user": "samuel", "descr": "Samuel likes mountain and kid\'s bikes.", "labels": "mountain, kids", "vector_embedding": [0.9, 0.7, 0.2]}'
Expand Down