diff --git a/docs/003-create-index.md b/docs/003-create-index.md index 72ca524..8622b70 100644 --- a/docs/003-create-index.md +++ b/docs/003-create-index.md @@ -113,13 +113,13 @@ Create the index with the following command: Before running some queries let's look at the command in detail: -* [`FT.CREATE`](https://oss.redislabs.com/redisearch/master/Commands/#ftcreate) : creates an index with the given spec. The index name will be used in all the key names so keep it short. +* [`FT.CREATE`](https://redis.io/commands/ft.create/) : creates an index with the given spec. The index name will be used in all the key names so keep it short. * `idx:movie` : the name of the index * `ON hash` : the type of structure to be indexed. *Note that in RediSearch 2.0 only hash structures are supported, this parameter will accept other Redis data types in future as RediSearch is updated to index them* * `PREFIX 1 "movie:"` : the prefix of the keys that should be indexed. This is a list, so since we want to only index movie:* keys the number is 1. Suppose you want to index movies and tv_show that have the same fields, you can use: `PREFIX 2 "movie:" "tv_show:"` -* `SCHEMA ...`: defines the schema, the fields and their type, to index, as you can see in the command, we are using [TEXT](https://oss.redislabs.com/redisearch/Query_Syntax/#a_few_query_examples), [NUMERIC](https://oss.redislabs.com/redisearch/Query_Syntax/#numeric_filters_in_query) and [TAG](https://oss.redislabs.com/redisearch/Query_Syntax/#tag_filters), and [SORTABLE](https://oss.redislabs.com/redisearch/Sorting/) parameters. +* `SCHEMA ...`: defines the schema, the fields and their type, to index, as you can see in the command, we are using [TEXT](https://redis.io/docs/stack/search/reference/query_syntax/#a-few-query-examples), [NUMERIC](https://redis.io/docs/stack/search/reference/query_syntax/#numeric-filters-in-query) and [TAG](https://redis.io/docs/stack/search/reference/tags/), and [SORTABLE](https://redis.io/docs/stack/search/reference/sorting) parameters. -You can find information about the [FT.CREATE](https://oss.redislabs.com/redisearch/Commands/#ftcreate) command in the [documentation](https://oss.redislabs.com/redisearch/Commands/#ftcreate). +You can find information about the `FT.CREATE` command in the [documentation](https://redis.io/commands/ft.create/). You can look at the index information with the following command: diff --git a/docs/004-query-data.md b/docs/004-query-data.md index 66601ca..c0e1023 100644 --- a/docs/004-query-data.md +++ b/docs/004-query-data.md @@ -26,7 +26,7 @@ The database contains a few movies, and an index, it is now possible to execute The FT.SEARCH commands returns a list of results starting with the number of results, then the list of elements (keys & fields). -As you can see the movie *Star Wars: Episode V - The Empire Strikes Back* is found, even though you used only the word “war” to match “Wars” in the title. This is because the title has been indexed as text, so the field is [tokenized](https://oss.redislabs.com/redisearch/Escaping/) and [stemmed](https://oss.redislabs.com/redisearch/Stemming/). +As you can see the movie *Star Wars: Episode V - The Empire Strikes Back* is found, even though you used only the word “war” to match “Wars” in the title. This is because the title has been indexed as text, so the field is [tokenized](https://redis.io/docs/stack/search/reference/escaping/) and [stemmed](https://redis.io/docs/stack/search/reference/stemming/). Later when looking at the query syntax in more detail you will learn more about the search capabilities. @@ -75,7 +75,7 @@ Adding the string `-jedi` (minus) will ask the query engine not to return values --- **Example : *All the movies that contains the string "`gdfather` using fuzzy search"*** -As you can see the word godfather contains a speelling error, it can however be matched using [fuzzy matching](https://oss.redislabs.com/redisearch/Query_Syntax/#fuzzy_matching). Fuzzy matches are performed based on [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) (LD). +As you can see the word godfather contains a speelling error, it can however be matched using [fuzzy matching](https://redis.io/docs/stack/search/reference/query_syntax/#fuzzy-matching). Fuzzy matches are performed based on [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) (LD). ``` > FT.SEARCH idx:movie " %gdfather% " RETURN 2 title release_year @@ -131,7 +131,7 @@ The syntax to query a TAG field is @field_name:{value} 4) "1980" ``` -You can find more information about the Tag filters in [the documentation](https://oss.redislabs.com/redisearch/master/Query_Syntax/#tag_filters). +You can find more information about the Tag filters in [the documentation](https://redis.io/docs/stack/search/reference/query_syntax/#tag-filters). --- **Example : *All `Thriller` or `Action` movies that does not have `Jedi` in the title"*** @@ -273,8 +273,8 @@ You can run the following query, and you will that the document expires after 20 ## More You have many additional features regarding indexing and searching that you can find in the documentation: -* [FT.SEARCH command](https://oss.redislabs.com/redisearch/master/Commands/#ftsearch) -* [Query Syntax](https://oss.redislabs.com/redisearch/master/Query_Syntax) +* [FT.SEARCH command](https://redis.io/commands/ft.search/) +* [Query Syntax](https://redis.io/docs/stack/search/reference/query_syntax) Let's see how to inspect, modify and drop an index. diff --git a/docs/007-query-movies.md b/docs/007-query-movies.md index eba4f63..47451a1 100644 --- a/docs/007-query-movies.md +++ b/docs/007-query-movies.md @@ -53,7 +53,7 @@ The first line contains the number of documents (`4`) that match the query condi This query is a "fieldless" condition, this means that the query engine has: * searched in all the TEXT fields of the index(`title` and `plot`) -* for the word `heat` and related words, this is why the movie:736 is returned since it has the word `heated` in the plot ([stemming](https://oss.redislabs.com/redisearch/Stemming/)) +* for the word `heat` and related words, this is why the movie:736 is returned since it has the word `heated` in the plot ([stemming](https://redis.io/docs/stack/search/reference/stemming/)) * returned the result sorted by score, remember that the title has a weight of 1.0, and the plot a weight of 0.5. So when the word or related words are found in the title the score is larger. --- @@ -145,7 +145,7 @@ As you have seen earlier the movie index contains: You saw earlier how to place a condition on a TEXT field. -The [TAG](https://oss.redislabs.com/redisearch/Tags/) is a little bit different as the index engine does not do any stemming. +The [TAG](https://redis.io/docs/stack/search/reference/tags/) is a little bit different as the index engine does not do any stemming. To set a condition on this field you must use the `@field:{value}` notation, the `{...}` indicates that it is a TAG condition @@ -290,7 +290,7 @@ The FT.SEARCH command, by default, returns the first ten documents. You will see You can only use one SORTBY clause in an FT.SEARCH query, if you want to sort on multiple fields, for example sorting movies by `genre` ascending and `release_year` descending, you have to use an FT.AGGREGATE, this is covered in the [next section](008-aggregation.md). -Note: The field used in the [SORTBY](https://oss.redislabs.com/redisearch/Sorting/#specifying_sortby) should be part of the index schema and defined as SORTABLE. +Note: The field used in the [SORTBY](https://redis.io/docs/stack/search/reference/sorting/#specifying-sortby) should be part of the index schema and defined as SORTABLE. --- diff --git a/docs/008-aggregation.md b/docs/008-aggregation.md index 57fa34a..b14c7cb 100644 --- a/docs/008-aggregation.md +++ b/docs/008-aggregation.md @@ -135,9 +135,9 @@ Let's check out some examples. The `idx:user` index contains the last_login field. This field stores the last login time as an EPOC timestamp. -RediSearch aggregation allows you to apply transformations to each record. This is done using the [APPLY](https://oss.redislabs.com/redisearch/Aggregations/#apply_expressions) parameter. +RediSearch aggregation allows you to apply transformations to each record. This is done using the [APPLY](https://redis.io/docs/stack/search/reference/aggregations/#apply-expressions) parameter. -For this example you have to use a [date/time](https://oss.redislabs.com/redisearch/Aggregations/#list_of_datetime_apply_functions) function to extract the month and year from the timestamp. +For this example you have to use a [date/time](https://redis.io/docs/stack/search/reference/aggregations/#list-of-datetime-apply-functions) function to extract the month and year from the timestamp. ``` > FT.AGGREGATE idx:user * APPLY year(@last_login) AS year APPLY "monthofyear(@last_login) + 1" AS month GROUPBY 2 @year @month REDUCE count 0 AS num_login SORTBY 4 @year ASC @month ASC @@ -194,7 +194,7 @@ Using the date/time Apply functions it is possible to extract the day of the wee In the previous example you used the `query string` parameter to select all documents (`"*"`) or a subset of the documents (`"@gender:{female}"`) -It is also possible to filter the results using a predicate expression relating to values in each result. This is applied post-query and relates to the current state of the pipeline. This is done using the [FILTER](https://oss.redislabs.com/redisearch/Aggregations/#filter_expressions) parameter. +It is also possible to filter the results using a predicate expression relating to values in each result. This is applied post-query and relates to the current state of the pipeline. This is done using the [FILTER](https://redis.io/docs/stack/search/reference/aggregations/#filter-expressions) parameter.
diff --git a/docs/009-advanced-features.md b/docs/009-advanced-features.md index 325bc7c..03c1ccb 100644 --- a/docs/009-advanced-features.md +++ b/docs/009-advanced-features.md @@ -6,7 +6,7 @@ In the previous examples, the indices were created using a `PREFIX`, where all t It is also possible to create an index using a filter, for example create an index with all the "Drama" movies released between 1990 and 2000 (2000 not included). -The [`FILTER`](https://oss.redislabs.com/redisearch/Aggregations/#filter_expressions)` expression is using the [aggregation filter syntax(https://oss.redislabs.com/redisearch/Aggregations/#filter_expressions)], for example for the genre and release year it will be +The [`FILTER`](https://redis.io/docs/stack/search/reference/aggregations/#filter-expressions) expression is using the [aggregation filter syntax(https://redis.io/docs/stack/search/reference/aggregations/#filter-expressions)], for example for the genre and release year it will be * `FILTER "@genre=='Drama' && @release_year>=1990 && @release_year<2000"`