Skip to content

Commit 490595d

Browse files
committed
Using keyword instead of not_analyzed
1 parent 07dbfe9 commit 490595d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

analysis.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ curl -XPOST 'http://localhost:9200/cities/_search?pretty' -d'
3535
'
3636

3737

38-
## With `not_analyzed` mapping
38+
## With `keyword` mapping
3939

4040
### Cleanup
4141
curl -XDELETE 'http://localhost:9200/cities'
@@ -47,8 +47,7 @@ curl -XPUT 'http://localhost:9200/cities' -d'
4747
"city": {
4848
"properties": {
4949
"city": {
50-
"type": "string",
51-
"index": "not_analyzed"
50+
"type": "keyword"
5251
}
5352
}
5453
}

load_into_elasticsearch.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ curl -XPOST 'http://localhost:9200/enron' -d'
99
"mappings": {
1010
"email": {
1111
"properties": {
12-
"sender": { "type": "string", "index": "not_analyzed" },
13-
"recipients": { "type": "string", "index": "not_analyzed" },
14-
"cc": { "type": "string", "index": "not_analyzed" },
15-
"bcc": { "type": "string", "index": "not_analyzed" },
12+
"sender": { "type": "keyword" },
13+
"recipients": { "type": "keyword" },
14+
"cc": { "type": "keyword" },
15+
"bcc": { "type": "keyword" },
1616
"subject": { "type": "string", "analyzer": "english" },
1717
"body": { "type": "string", "analyzer": "english" }
1818
}

0 commit comments

Comments
 (0)