Skip to content

Commit 0d9bee7

Browse files
author
Ariel Shtul
authored
Merge branch 'master' into ft.info-complexity
2 parents 69c0d18 + e1c2660 commit 0d9bee7

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

docs/Commands.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ FT.CREATE idx ON JSON SCHEMA $.title AS title TEXT $.categories AS categories TA
230230
must be a single character.
231231

232232
* **CASESENSITIVE**
233+
234+
For `TAG` attributes, keeps the original letter cases of the tags.
235+
If not specified, the characters are converted to lowercase.
233236

234237
#### Complexity
235238
O(1)

docs/Tags.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
# Tag Fields
22

3-
RediSearch 0.91 adds a new kind of field - the Tag field. They are similar to full-text fields but use simpler tokenization and encoding in the index. The values in these fields cannot be accessed by general field-less search and can be used only with a special syntax.
3+
Tag fields are similar to full-text fields but use simpler tokenization and encoding in the index. The values in these fields cannot be accessed by general field-less search and can be used only with a special syntax.
44

55
The main differences between tag and full-text fields are:
66

77
1. We do not perform stemming on tag indexes.
88

9-
2. The tokenization is simpler: The user can determine a separator (defaults to a comma) for multiple tags, and we only do whitespace trimming at the end of tags. Thus, tags can contain spaces, punctuation marks, accents, etc. The only two transformations we perform are lower-casing (for latin languages only as of now), and whitespace trimming.
9+
2. The tokenization is simpler: The user can determine a separator (defaults to a comma) for multiple tags, and we only do whitespace trimming at the end of tags. Thus, tags can contain spaces, punctuation marks, accents, etc.
1010

11-
3. Tags cannot be found from a general full-text search. If a document has a field called "tags" with the values "foo" and "bar", searching for foo or bar without a special tag modifier (see below) will not return this document.
11+
3. The only two transformations we perform are lower-casing (for latin languages only as of now) and whitespace trimming. Lower-case transformation can be disabled by passing CASESENSITIVE.
1212

13-
4. The index is much simpler and more compressed: We do not store frequencies, offset vectors of field flags. The index contains only document IDs encoded as deltas. This means that an entry in a tag index is usually one or two bytes long. This makes them very memory efficient and fast.
13+
4. Tags cannot be found from a general full-text search. If a document has a field called "tags" with the values "foo" and "bar", searching for foo or bar without a special tag modifier (see below) will not return this document.
1414

15-
5. An unlimited number of tag fields can be created per index, as long as the overall number of fields is under 1024.
15+
5. The index is much simpler and more compressed: We do not store frequencies, offset vectors of field flags. The index contains only document IDs encoded as deltas. This means that an entry in a tag index is usually one or two bytes long. This makes them very memory efficient and fast.
16+
17+
6. An unlimited number of tag fields can be created per index, as long as the overall number of fields is under 1024.
1618

1719
## Creating a tag field
1820

1921
Tag fields can be added to the schema in FT.ADD with the following syntax:
2022

2123
```
22-
FT.CREATE ... SCHEMA ... {field_name} TAG [SEPARATOR {sep}]
24+
FT.CREATE ... SCHEMA ... {field_name} TAG [SEPARATOR {sep}] [CASESENSITIVE]
2325
```
2426

2527
SEPARATOR defaults to a comma (`,`), and can be any printable ASCII character. For example:
2628

29+
CASESENSITIVE can be specified to keep the original letters case.
30+
2731
```
2832
FT.CREATE idx ON HASH PREFIX 1 test: SCHEMA tags TAG SEPARATOR ";"
2933
```

0 commit comments

Comments
 (0)