Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| // create an index with an analyzer "myindex" | |
| curl -X PUT localhost:9200/myindex -d ' | |
| { | |
| "settings" : {` | |
| "index":{ | |
| "number_of_replicas":0, | |
| "number_of_shards":1, | |
| "analysis":{ | |
| "analyzer":{ | |
| "first":{ |
| console.log(1); | |
| (_ => console.log(2))(); | |
| eval('console.log(3);'); | |
| console.log.call(null, 4); | |
| console.log.apply(null, [5]); | |
| new Function('console.log(6)')(); | |
| Reflect.apply(console.log, null, [7]) | |
| Reflect.construct(function(){console.log(8)}, []); | |
| Function.prototype.apply.call(console.log, null, [9]); | |
| Function.prototype.call.call(console.log, null, 10); |
| <powershell> | |
| iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
| choco install python -y | |
| (new-object net.webclient).DownloadFile('https://s3.amazonaws.com/aws-cli/AWSCLI64.msi','c:\AWSCLI64.msi') | |
| msiexec.exe /i 'C:\AWSCLI64.msi' /qn | |
| </powershell> |
| #!/bin/bash | |
| yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https -y | |
| curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O | |
| unzip CloudWatchMonitoringScripts-1.2.1.zip | |
| rm CloudWatchMonitoringScripts-1.2.1.zip |
| # http://stackoverflow.com/questions/1388025/how-to-get-id-of-the-last-updated-row-in-mysql | |
| # single row update | |
| SET @update_id := 0; | |
| UPDATE some_table SET column_name = 'value', id = (SELECT @update_id := id) | |
| WHERE some_other_column = 'blah' LIMIT 1; | |
| SELECT @update_id; | |
| # Multiple rows updated | |
| SET @uids := null; |