Skip to content

Commit 758855a

Browse files
committed
#3: Try testing mapper-size plugin on ES.
1 parent 3fa2cc3 commit 758855a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

examples/elasticsearch-6.5/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ lando ssh -s app -c "curl localhost/esearch.php" | grep "Barbara Liskov"
4848

4949
# Should be running the correct elasticsearch versions (plugin service)
5050
lando ssh -s searchelastic-plugin -c "curl -XGET 'http://localhost:9200'" | grep 6.5
51+
52+
# Should be able to enable the _size field for mapper-size plugin
53+
lando ssh -s searchelastic-plugin -c "curl -X PUT 'localhost:9200/my_index?pretty' -H 'Content-Type:application/json' -d'{\"mappings\": {\"_doc\": {\"_size\": {\"enabled\": true}}}}'"
54+
55+
# Should be able to add a doc to the ES index
56+
lando ssh -s searchelastic-plugin -c "curl -X PUT 'localhost:9200/my-index/_doc/1?pretty' -H 'Content-Type: application/json' -d'{\"text\": \"This is a document\"}'"
57+
58+
# Should see _size field when querying ES index.
59+
lando ssh -s searchelastic-plugin -c "curl -X GET 'localhost:9200/my_index/_search?pretty' -H 'Content-Type: application/json' -d '{ \"query\": { \"range\": { \"_size\": { \"gt\": 10 } } }, \"aggs\": { \"sizes\": { \"terms\": { \"field\": \"_size\", \"size\": 10 } } }, \"sort\": [ { \"_size\": { \"order\": \"desc\" } } ], \"script_fields\": { \"size\": { \"script\": \"doc[\\u0027_size\\u0027]\" } }}'" | grep sizes
60+
5161
```
5262

5363
Destroy tests

0 commit comments

Comments
 (0)