Skip to content

Commit 59cabfe

Browse files
committed
Using _source_include instead of the obsolete fields
1 parent 8fa4994 commit 59cabfe

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

queries.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
#### Using curl
1212

13-
curl 'http://localhost:9200/enron/_search?pretty&q=subject:monetary&fields=subject'
13+
curl 'http://localhost:9200/enron/_search?pretty&q=subject:monetary&_source_include=subject'
1414

1515
#### Using Console (fka Sense)
1616

17-
GET /enron/_search?q=subject:monetary&fields=subject
17+
GET /enron/_search?q=subject:monetary&_source_include=subject
1818

1919
## Search for text in multiple fields
2020

@@ -26,11 +26,11 @@
2626

2727
#### Using curl
2828

29-
curl 'http://localhost:9200/enron/_search?pretty&q=subject:monetary+body:monetary&fields=subject'
29+
curl 'http://localhost:9200/enron/_search?pretty&q=subject:monetary+body:monetary&_source_include=subject'
3030

3131
#### Using Console (fka Sense)
3232

33-
GET /enron/_search?q=subject:monetary+body:monetary&fields=subject
33+
GET /enron/_search?q=subject:monetary+body:monetary&_source_include=subject
3434

3535
## Search for a phrase
3636

@@ -42,7 +42,7 @@
4242

4343
#### Using curl
4444

45-
curl -XPOST 'http://localhost:9200/enron/_search?pretty&fields=subject' -d'
45+
curl -XPOST 'http://localhost:9200/enron/_search?pretty&_source_include=subject' -d'
4646
{
4747
"query": {
4848
"match_phrase": {
@@ -53,14 +53,11 @@
5353

5454
#### Using Console (fka Sense)
5555

56-
POST /enron/_search
56+
POST /enron/_search?_source_include=subject
5757
{
5858
"query": {
5959
"match_phrase": {
6060
"body": "monetary fund"
6161
}
62-
},
63-
"fields": [
64-
"subject"
65-
]
62+
}
6663
}

0 commit comments

Comments
 (0)