Skip to content

Commit 810dea5

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

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

examples/elasticsearch-6.5/.platform.app.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ web:
88
root: "."
99
passthru: "/index.php"
1010
relationships:
11-
elasticsearch: "searchelastic:elasticsearch"
1211
elasticsearch-plugin: "searchelastic-plugin:elasticsearch"

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)