Skip to content

Commit adaf43f

Browse files
Some phrasing and spelling updates.
1 parent 76d78f7 commit adaf43f

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/003-create-index.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ Before creating the index let's describe the dataset and insert entries.
44

55
## Sample Dataset
66

7-
In this project you will use a simple dataset describging movies, for now, all record are in English. You will learn more about other languages in another tutorial.
7+
In this project you will use a simple dataset describing movies, for now, all records are in English. You will learn more about other languages in another tutorial.
88

99
A movie is represented by the following attributes:
1010

1111
* **`movie_id`** : The unique ID of the movie, internal to this database
1212
* **`title`** : The title of the movie.
1313
* **`plot`** : A summary of the movie.
14-
* **`genre`** : The genre of the movie, for now a movie will only h ave one single genre.
15-
* **`release_year`** : The year the movie has been released as a numerical value.
16-
* **`rating`** : The ratings from the public numerical value.
14+
* **`genre`** : The genre of the movie, for now a movie will only have a single genre.
15+
* **`release_year`** : The year the movie was released as a numerical value.
16+
* **`rating`** : A numeric value representing the public's rating for this movie.
1717
* **`votes`** : Number of votes.
1818
* **`poster`** : Link to the movie poster.
1919
* **`imdb_id`** : id of the movie in the [IMDB](https://imdb.com) database.
2020

2121

2222
### Key and Data structure
2323

24-
As a Redis developer, one of the first thing to look when building your application is to define the structure of the key and data (data design/data modeling).
24+
As a Redis developer, one of the first things to look when building your application is to define the structure of the key and data (data design/data modeling).
2525

26-
A common way of defining the keys in Redis is to use specific pattern in them for example in this application when the database will probably deal with various business objects: movies, actors, theaters, users, ... we can use the following pattern:
26+
A common way of defining the keys in Redis is to use specific patterns in them. For example in this application where the database will probably deal with various business objects: movies, actors, theaters, users, ... we can use the following pattern:
2727

2828
* `business_object:key`
2929

@@ -32,14 +32,14 @@ For example:
3232
* `user:001` the user with the id 001
3333

3434

35-
and for the movies information you should use a Rediss [Hashes](https://redis.io/topics/data-types#hashes).
35+
and for the movies information you should use a Redis [Hash](https://redis.io/topics/data-types#hashes).
3636

37-
A Redis Hash will allow the application to structure all the movie attributes in individual field; also RediSearch will index the fields based on the index definition.
37+
A Redis Hash allows the application to structure all the movie attributes in individual fields; also RediSearch will index the fields based on the index definition.
3838

3939
## Insert Movies
4040

4141

42-
It is time now to add some data into your database, let's insert few movies, using `redis-cli` or [Redis Insight](https://redislabs.com/redisinsight/).
42+
It is time now to add some data into your database, let's insert a few movies, using `redis-cli` or [Redis Insight](https://redislabs.com/redisinsight/).
4343

4444
Once you are connected to your Redis instance run the following commands:
4545

@@ -55,7 +55,7 @@ Once you are connected to your Redis instance run the following commands:
5555
5656
```
5757

58-
Now it is possible to get information from the hash using the movie ID for example if you want to get the title, and rating execute the following command:
58+
Now it is possible to get information from the hash using the movie ID. For example if you want to get the title, and rating execute the following command:
5959

6060
```
6161
> HMGET movie:11002 title rating
@@ -71,23 +71,23 @@ And you can increment the rating of this movie using:
7171
"8.8"
7272
```
7373

74-
But how do you get a movie or list of movies from the release year, rating value or title?
74+
But how do you get a movie or list of movies by year of release, rating or title?
7575

76-
One option, would be to read all the movies, check all fields and then return the movies; no need to say that it is a really bad idea.
76+
One option, would be to read all the movies, check all fields and then return only matching movies; no need to say that this is a really bad idea.
7777

78-
Nevertheless this is where Redis developer are creating custom secondary index using SET/SORTED SET structures that point back to the movie hash. This needs some heavy design and implementation.
78+
Nevertheless this is where Redis developers often create custom secondary indexes using SET/SORTED SET structures that point back to the movie hash. This needs some heavy design and implementation.
7979

80-
This is where RediSearch module is helping, and why it as been created.
80+
This is where the RediSearch module can help, and why it was created.
8181

8282

8383
## RediSearch & Indexing
8484

8585

86-
RediSearch simplifies a lot this by offering a simple and automatic way to create secondary indices on Redis Hashes. (more datastructure will eventually come)
86+
RediSearch greatly simplifies this by offering a simple and automatic way to create secondary indices on Redis Hashes. (more datastructure will eventually come)
8787

8888
![Secondary Index](https://github.com/RediSearch/redisearch-getting-started/blob/master/docs/images/secondary-index.png?raw=true)
8989

90-
Using RediSearch if you want to query on a field, you must index the fields. Let's start by indexing the following fields in of our movies:
90+
Using RediSearch if you want to query on a field, you must first index that field. Let's start by indexing the following fields for our movies:
9191

9292
* Title
9393
* Release Year
@@ -101,7 +101,7 @@ When creating a index you define:
101101

102102
> ***Warning: Do not index all fields***
103103
>
104-
> Indexes take space in memory, and must be updated when the primary data is updated. So create the index carefully and keep the definition up to date with your need.
104+
> Indexes take space in memory, and must be updated when the primary data is updated. So create the index carefully and keep the definition up to date with your needs.
105105
106106
### Create the Index
107107

@@ -115,9 +115,9 @@ Before running some queries let's look at the command in detail:
115115

116116
* [`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.
117117
* `idx:movie` : the name of the index
118-
* `ON hash` : the type of structure to be indexed. *Note that in RediSearch 2.0 only hash structure are supported, this is parameter will allow RediSearch to index other structure in the future*
118+
* `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*
119119
* `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:"`
120-
* `SCHEMA ...`: define 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.
120+
* `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.
121121

122122
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).
123123

0 commit comments

Comments
 (0)