File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99### Elasticsearch
1010
11+ #### Using curl
12+
1113 curl 'http://localhost:9200/enron/_search?pretty&q=subject:monetary&fields=subject'
1214
15+ #### Using Console (fka Sense)
16+
17+ GET /enron/_search?q=subject:monetary&fields=subject
18+
1319## Search for text in multiple fields
1420
1521### SQL
1824
1925### Elasticsearch
2026
27+ #### Using curl
28+
2129 curl 'http://localhost:9200/enron/_search?pretty&q=subject:monetary+body:monetary&fields=subject'
2230
31+ #### Using Console (fka Sense)
32+
33+ GET /enron/_search?q=subject:monetary+body:monetary&fields=subject
2334
2435## Search for a phrase
2536
2940
3041### Elasticsearch
3142
43+ #### Using curl
44+
3245 curl -XPOST 'http://localhost:9200/enron/_search?pretty&fields=subject' -d'
3346 {
3447 "query": {
3851 }
3952 }'
4053
41- ## Show top 10 senders
42-
43- ### SQL
44-
45- SELECT sender, COUNT(*) AS num_emails_sent FROM emails GROUP BY sender ORDER BY num_emails_sent DESC LIMIT 10;
54+ #### Using Console (fka Sense)
4655
47- ### Elasticsearch
48-
49- curl -XPOST 'http://localhost:9200/enron/_search?pretty' -d '{
50- "size": 0,
51- "aggs": {
52- "top_10_senders": {
53- "terms": {
54- "field": "sender"
55- }
56+ POST /enron/_search
57+ {
58+ "query": {
59+ "match_phrase": {
60+ "body": "monetary fund"
5661 }
57- }
58- }'
62+ },
63+ "fields": [
64+ "subject"
65+ ]
66+ }
You can’t perform that action at this time.
0 commit comments